2 Commits

Author SHA1 Message Date
sp00nz fd2fcc690b install_deps.sh: detect the distro instead of assuming Debian
The script hardcoded apt and Debian package names, so it was useless on
anything else -- issue #1 came from a CachyOS user who had no way to use it.
Now reads ID/ID_LIKE from /etc/os-release and dispatches to apt, pacman, or
dnf with that distro's spelling of the same dependencies. Unknown distros get
the dependency list to install by hand rather than a failed apt call.

Checking ID_LIKE (not just ID) is what makes the derivatives work: CachyOS,
Manjaro, and Ubuntu all identify as themselves and only name their base there.

test_install_deps.sh covers the detection against real ID/ID_LIKE lines from
each distro, plus an unknown distro and a missing os-release. Also drops the
header's stale claim that this is for "the Burnout 3 static recompilation" --
it is the toolkit's runtime libraries.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-16 18:12:33 -07:00
sp00nz efb225a8da Add platform layer + OpenGL d3d8 backend + Linux build deps
Mirrored from sp00nznet/burnout3 linux-port branch (commit bc15743),
where this scaffolding was developed and verified to produce a 38 MB
ELF64 burnout3 binary on Debian 13.

New files (zero overlap with existing xboxrecomp code):

src/platform/ -- the cross-platform foundation
  xbox_winnt.h      Portable NT type vocabulary (HANDLE, ULONG, NTSTATUS,
                    LARGE_INTEGER, CRITICAL_SECTION, CONDITION_VARIABLE,
                    HRESULT, PCONTEXT, HWND, MSG, WAVEFORMATEX,
                    XBOX_THREAD_LOCAL, __debugbreak). Resolves to
                    <windows.h> on _WIN32; defines the types on POSIX.
  win32_compat.h    Declares ~80 POSIX-backed Win32 host primitives.
  win32_compat.c    Implementations: threads (pthread), events/mutexes
                    /semaphores (condvar-backed), interlocked atomics,
                    waitable kernel objects with handle table,
                    CRITICAL_SECTION (recursive pthread mutex),
                    CONDITION_VARIABLE (pthread_cond), timer queues,
                    heap, virtual memory + memfd-backed file mapping
                    (true aliased mirror views), time + FILETIME,
                    Win32 file API (CreateFile/Read/Write/GetFileSize)
                    on POSIX open/read/write/fstat, MultiByteToWideChar
                    UTF-8<->UTF-16, GetAsyncKeyState/MessageBox/window
                    helpers (stubs), XInput stub, _alloca/_clearfp/
                    SecureZeroMemory/ExitProcess shims, waveOut stubs,
                    SEH RaiseException/RtlUnwind compile-shims.
  CMakeLists.txt    INTERFACE library on Windows; STATIC + Threads on POSIX.

src/d3d/d3d8_gl.c -- the OpenGL backend for the D3D8 compat layer
  SDL2 window + GL 3.3 core context in CreateDevice. Full IDirect3D8,
  IDirect3DDevice8 (~50 vtable slots), Texture8, Surface8, VertexBuffer8,
  IndexBuffer8 implementations. Real Clear/Present (with SDL event pump)
  /BeginScene/EndScene/viewport, render-state caching with apply path
  (depth/blend/cull/colormask), CreateTexture+CreateBuffer with shadow
  memory and glGen*, DrawPrimitive/DrawIndexedPrimitive(UP) with
  FVF-driven attribute pointers (position+diffuse+UV) and a fixed GLSL
  program with switchable XYZRHW path. Picked by CMake on POSIX.

templates/runtime/recomp_types.h -- add __forceinline / __debugbreak
  macros so MSVC-style generated code compiles unchanged on gcc/clang.

tools/linux/install_deps.sh -- one-shot Debian/Ubuntu apt install:
  cmake, build-essential, pkg-config, libsdl2-dev, libgl1-mesa-dev,
  libepoxy-dev, libssl-dev, libavcodec/format/util/swscale-dev.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-26 22:01:07 -07:00