BSD 3-Clause License Copyright (c) 2026, Ben Templeman and contributors Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # Third-party components This project's own code is under the BSD-3-Clause licence (`LICENSE`). The code below keeps its own licence and notices; every component linked into the game is under a licence compatible with it (BSD, zlib, MIT, public domain). Every component this project fetches, links or reads from is recorded here: upstream, pinned commit, licence, how it is used and what was changed. Vendored checkouts live in git-ignored `extern/` and are never committed. | Component | Upstream | Commit | Licence | Use | Changes | | --- | --- | --- | --- | --- | --- | | MAME `src/devices/cpu/i960/i960dis.cpp`, `i960dis.h` | https://github.com/mamedev/mame | `dddd73680656e355bb2b5beecab1167c9f07bf81` | BSD-3-Clause (file header) | Compiled unmodified into the `mame_oracle` test only, as the reference disassembler. Not linked into any tool or shipped binary. | None. `tests/mame_shim/emu.h` (ours) stands in for MAME's `emu.h`. | | MAME `src/devices/cpu/i960/i960.cpp` (decoder reference) | same | same | BSD-3-Clause | Read: the executor's opcode set, operand, EA and branch-target rules are what `src/i960/decode.cpp` follows. | — | | MAME `src/devices/cpu/i960/i960.cpp` (instruction semantics) | same | same | BSD-3-Clause | **Code transplanted** into `src/runtime/cpu.cpp` (context, call/return, interrupts, memory; linked into the game) and `src/refcore/i960_ref.cpp` (the instruction interpreter; test oracle only, never linked into the game), BSD-3 notice kept in both. MAME's semantics are used verbatim so the runtime diffs cleanly against MAME in lockstep. Licence-compatible with any project licence. | Device framework, cycle accounting and burst-stall machinery removed; memory through `rt::Bus`; `fatalerror` throws; interrupt-taken hook added. Every change is marked in the file. | | MAME `src/mame/sega/model2*.cpp`, `src/mame/shared/segam1audio.cpp` | same | same | BSD-3-Clause | Read, not compiled: hardware figures in the design document. | — | | MAME `src/devices/cpu/mb86233/mb86233.cpp` (TGP semantics) | same | same | BSD-3-Clause | **Code transplanted** into `src/runtime/tgp.h` as inline templates on each instruction's constant fields; `tools/m2tgprecomp` emits calls to them, so the TGP program is statically recompiled. No MB86233 interpreter exists in this project. BSD-3 notice kept. | Split per ALU op, addressing mode and register into `if constexpr` templates; stall handled by returning to the caller; shift counts made explicit mod 32 and `s32(float)` made explicit (x86 result), matching MAME's x86-64 build on any host. | | MAME `src/mame/sega/model2.cpp` (board registers: IRQ controller, timers, video/render mode, TGP ID, model2o memory map) | same | same | BSD-3-Clause | **Register semantics transplanted** into `src/runtime/m2_board.cpp`, the native board the game runs on outside lockstep. BSD-3 notice kept. The I/O board's mailbox protocol is not from MAME (which runs the board's Z80 BIOS): it was read from the game's own traffic in our traces. | No device emulation: the I/O board, sound UART and comm board are native runtime code answering the game's protocol. | | MAME `src/mame/sega/segaic24.cpp` (System 24 tilemap chip), `model2_v.cpp`/`model2.cpp` (`screen_update`, `palette_w`, `colorxlat_w`, CRTC sync handlers) | same | same | BSD-3-Clause | **Code transplanted** into `src/runtime/video.cpp`: `tile_info`, `draw_rect` (rgb32), `draw_common` with its special scroll/window modes, the palette pen rules and the screen composition order. BSD-3 notices kept. | MAME's generic tilemap engine (`src/emu/tilemap.cpp`, read for its pixel rule, not copied) replaced by a direct pixmap build and a one-scroll-value draw with the same category/opacity test. | | MAME `src/mame/sega/model2rd.ipp`, `model2_v.cpp` (renderer) and `src/devices/video/poly.h` (triangle/polygon setup) | same | same | BSD-3-Clause | **Code transplanted** into `src/runtime/raster.cpp`: `model2_3d_project`, `render_polygons` order, `model2_3d_render`, the scanline shaders and bilinear texel fetch, and poly.h's `render_triangle`, `render_polygon`, `round_coordinate`. The CPU reference for the 3D layer. BSD-3 notices kept. | Drawn immediately instead of through poly.h's work queue (same per-pixel order); float-to-int conversions that can overflow or see a NaN pinned to the x86 result so every host agrees. | | MAME `src/mame/sega/model2_v.cpp` (geometrizer HLE, rasterizer front end) | same | same | BSD-3-Clause | **Code transplanted** into `src/runtime/geo.cpp`: `geo_parse` and every geometrizer command, `model2_3d_push`, `model2_3d_process_polygon`, `float_to_zval`, `clip_polygon`, `check_culling`, the 3D math helpers. BSD-3 notice kept. The original Model 2's geometrizer runs undumped code from ROM inside its DSP, so MAME's HLE is the reference. | Raw pointers become bounds-checked cursors (running off memory is a hard error, not undefined behaviour); kept polygons go to a flat list instead of per-z buckets; `logerror` dropped, `fatalerror` throws. | | MAME `src/mame/sega/model2.cpp` (`model2_tgp_state` TGP I/O; copro and geo ports) | same | same | BSD-3-Clause | **Code transplanted** into `src/runtime/tgp.cpp` (sin/cos, atan, 1/x, 1/sqrt table ports, banked window) and `src/runtime/m2_tgp_board.cpp` (`copro_ctl1_w`, function port, FIFO ports, `geo_r`/`geo_w`/`geo_prg_w`/`geo_ctl1_w`, `push_geo_data`, buffer RAM reset value). BSD-3 notice kept in both. | Memory through `rt::TgpBus`; MAME's device FIFOs, halts and stalls replaced by running the recompiled TGP on demand; an out-of-range geometrizer push is a hard error (MAME writes past the array). | | `patches/mame/0001-i960-indirect-branch-harvest.patch` | ours, against MAME `dddd7368` | — | BSD-3-Clause, as the file it patches | Applied by `scripts/fetch_mame.sh`. Logs every `bx`/`balx`/`callx`/`calls` target, interrupt vector target, ICR value set by `synmov` and IAC reinitialise target to `$M2TRACE_BRANCHES` at exit; counts completed instructions; `$M2TRACE_IRQLOG` logs interrupt lines and takes by instruction count; `$M2TRACE_PCLOG` logs count, PIP, AC and a register hash per instruction. All off unless the variables are set. | Adds `device_stop`, an instruction counter and log points to `src/devices/cpu/i960/i960.{h,cpp}`. | | `patches/mame/0002-tgp-and-geometrizer-log.patch` | ours, against MAME `dddd7368` | — | BSD-3-Clause, as the files it patches | Applied by `scripts/fetch_mame.sh`. `$M2TRACE_TGPLOG`: the TGP program upload and every TGP-side FIFO pop and push, bank write and banked memory access, in order. `$M2TRACE_TGPPC`: PC, A, B, D, P and ST after each TGP instruction (capped by `$M2TRACE_TGPPC_MAX`). `$M2TRACE_GEOLOG`: each vblank with the i960 instruction count, every word the geometrizer hands the rasterizer, every polygon kept after culling and clipping, a hash of each rendered 3D layer with the CRTC offsets, and each screen update's i960 instruction count and composed-screen hash (`$M2TRACE_FBDUMP_DIR`/`$M2TRACE_FBDUMP_EVERY` dump raw frames). Off unless set. | Log points in `src/mame/sega/model2.cpp` (TGP register-file FIFO handlers wrapped, `screen_vblank`), `src/mame/sega/model2_v.cpp` (`model2_3d_push`, `model2_3d_process_polygon`, `render_polygons`, `screen_update`) and `src/devices/cpu/mb86233/mb86233.cpp`; `i960.h` gains a public `insn_count()` (patch 0001). | | `patches/mame/0003-sound-cpu-log.patch` | ours, against MAME `dddd7368` | — | BSD-3-Clause, as the files it patches | Applied by `scripts/fetch_mame.sh`. `$M2TRACE_SNDLOG`: the sound 68000's instruction count, every interrupt it takes, its registers every 4,096 instructions and after each interrupt, and every device access (UART, MultiPCMs and their banks, YM3438) with the index of the instruction making it. Off unless set. | Counter and log points in `src/devices/cpu/m68000/m68000.{h,cpp}`; the sound board's device handlers in `src/mame/shared/segam1audio.cpp` wrapped to log. | | MAME `src/mame/sega/m2comm.cpp`, `m2comm.h` (Model 2 communication board, `M2COMM_SIMULATION`) | https://github.com/mamedev/mame | `dddd73680656e355bb2b5beecab1167c9f07bf81` | BSD-3-Clause (Ariane Fugmann) | **Code transplanted** into `src/runtime/comm_board.{h,cpp}`: the link protocol (shared RAM set-up, the ring's numbering tokens, per-frame data and vsync frames), linked into the game for link play. BSD-3 notice kept. | `osd_file` sockets replaced by a non-blocking `LinkTransport` (TCP in `src/app/link_socket.cpp`, ours), so partial frames are kept until whole; the frame-sync wait gives up after 3 s (MAME waits forever); a closed line on either side loses the link; verbose logging dropped. | | MAME `src/devices/sound/multipcm.cpp`, `gew.cpp` (Yamaha YMW-258-F MultiPCM) | https://github.com/mamedev/mame | `dddd73680656e355bb2b5beecab1167c9f07bf81` | BSD-3-Clause (Miguel Angel Horna) | **Code transplanted** into `src/runtime/multipcm.{h,cpp}`: register writes, sample header loading, envelope, LFO and the sample loop, linked into the game. BSD-3 notice kept. | Device framework, streams, save states and `device_rom_interface` removed (sample ROM and bank as plain members); a write to a slot number with no voice is ignored (MAME indexes past its array). | | MAME `src/devices/cpu/m68000/m68kdasm.cpp` | same | same | BSD-3-Clause | Read, not compiled into anything we ship: `src/m68k/decode.cpp`'s `format_mame` reproduces its text so decodes can be checked against it (done once over the whole sound program with MAME's built `libdasm`). | — | | ymfm | https://github.com/aaronsgiles/ymfm | `81aec25ccbb98f4873a255f7551ac4dadac59b4a` | BSD-3-Clause | Linked into the runtime: the YM3438 (`ymfm::ym3438`) on the sound board. Fetched by `scripts/setup.py` into git-ignored `extern/ymfm`. The OPN2 path is identical to MAME's copy at `dddd7368`. | None. | | MAME Lua scripting API (`docs/source/luascript/`) | same | same | BSD-3-Clause | Read, not compiled: the API `tools/mame-plugins/m2trace` is written against. No code copied. | — | | Berkeley SoftFloat 3e | https://github.com/ucb-bar/berkeley-softfloat-3 | `a0c6494cdc11865811dec815d5c0049fba9d82a8` | BSD-3-Clause | Linked into the `i960` library as the extF80 reference model for i960 FP (`src/i960/fp.cpp`, `ref_*`). Fetched by `scripts/fetch_softfloat.sh`; built from `cmake/softfloat_sources.cmake` (FAST_INT64, 8086-SSE specialisation). | None. Built with its own options; `THREAD_LOCAL` set so rounding mode and flags are per thread. | | SDL 3 | https://github.com/libsdl-org/SDL | `fa2c02bb6e21974a89ea9824bc53c9932abe5f9c` (release-3.4.16) | Zlib | Linked statically into the `daytona` executable: window, input, gamepads, and SDL_GPU (Vulkan, Direct3D 12, Metal) to present frames. Fetched by `scripts/setup.py` into git-ignored `extern/sdl3`, built from source with the project. | `patches/sdl3/0001-vulkan-application-name.patch`, applied by `scripts/setup.py`: the Vulkan instance reports the application's name (SDL_SetAppMetadata) and no engine name instead of "SDLGPU", so overlays such as MangoHud show Vulkan. | | Dear ImGui | https://github.com/ocornut/imgui | `f1cc2ae15e53a861a874c3034aae6798fde194ab` (v1.92.9b) | MIT | Linked into the `daytona` executable: the launcher interface, with its SDL3 and SDL_GPU backends (shaders precompiled upstream for SPIR-V, DXIL, MSL). Fetched by `scripts/setup.py` into git-ignored `extern/imgui`. | None. | | 7-Zip LZMA SDK (`C/` of 7-Zip) | https://github.com/ip7z/7zip | `0766b733fe3e06dd2a7f9a3cfbf2108ac73abd17` (26.03) | Public domain (only files whose headers state "Public domain" are built: 7zArcIn, 7zDec, 7zBuf, 7zCrc, 7zCrcOpt, 7zStream, 7zAlloc, Alloc, LzmaDec, Lzma2Dec, Bra, Bra86, BraIA64, Bcj2, Delta, CpuArch, Ppmd7, Ppmd7Dec; none of 7-Zip's LGPL files) | Linked into the runtime to read 7z ROM sets (LZMA, LZMA2, PPMd, branch filters). Fetched by `scripts/setup.py` into git-ignored `extern/lzma`. | None; built with `Z7_PPMD_SUPPORT`. | | pypcode | https://github.com/angr/pypcode | PyPI 3.3.3 | BSD-2-Clause | Test-only: its SLEIGH compiler and decoder run the i960 module in `tests/ghidra_oracle.py`. Not shipped; the test skips (77) without it. | — | | ghidra_i960 (third-party Ghidra i960 processor module) | https://github.com/mumbel/ghidra_i960 | `727ef7872c5b1cd6ceb5a81f5e474d1ced92945c` | Apache-2.0 | Test-only second decode reference (SLEIGH), and the Ghidra module for the analysis workbench. Fetched by `scripts/fetch_ghidra_i960.sh` into git-ignored `extern/`. Not shipped. | None; compiled `.sla` is a local build artefact. | | lupa (Python binding with Lua 5.4) | https://github.com/scoder/lupa | PyPI release, not pinned | MIT | Test-only: runs the plugin's Lua under `tests/lua_*_test.py`. Not shipped. Tests skip (exit 77) without it. | — | Fetch with `scripts/fetch_mame.sh`, which checks out exactly the commit above. Supermodel (https://github.com/trzy/Supermodel, GPL-3.0, `Src/Model3/DriveBoard/WheelBoard.cpp` at its master branch, read in October 2026) was read as a reference only, for the meanings of Sega's drive board commands. No code was taken from it. Daytona's drive board turned out to use other meanings; `src/runtime/drive_board.h` now follows Daytona's own drive board program (EPR-16488A), read and run in MAME. The Model 2 MiSTer core (https://github.com/alphanu1/sega-model2-mister, GPL-3.0-or-later, read at `591e148e87d27e03d50cbf7318bf0b1d1328c4bf`) is read as a reference only. Nothing is lifted from it: it is GPL, and this project is BSD-3-Clause (`LICENSE`). ## Shader compilers (tools only) The hardware renderer's shaders (`src/app/gpu/m2.hlsl`, our own) are compiled by `scripts/build_shaders.py` into `src/app/gpu/shaders_gen.h`. Neither tool is part of the game or linked into it. | Tool | Version | Licence | Used for | | --- | --- | --- | --- | | [DirectXShaderCompiler](https://github.com/microsoft/DirectXShaderCompiler) | v1.9.2609 (`linux_dxc_2026_09_28`) | University of Illinois/NCSA | HLSL to SPIR-V and DXIL | | [SPIRV-Cross](https://github.com/KhronosGroup/SPIRV-Cross) | Ubuntu 24.04's package | Apache-2.0 | SPIR-V to MSL | Vita GPU display buffering builds MIT libvita2d at `a8f15ab09d5233f0a4e4ad0e8f6ade0da888cbed` from https://github.com/xerpi/libvita2d. The source hash, small display-ring adapter and shipped license are documented in [the Vita dependency record](platform/vita/THIRD_PARTY.md). Korean replacement lettering: Nanum Myeongjo ExtraBold (NAVER Corporation), SIL Open Font License 1.1. Source: https://github.com/google/fonts/tree/main/ofl/nanummyeongjo . Full license: nanum-font-license.txt. Only newly rendered Korean glyph bitmaps are used; the font file is not bundled.