Commit Graph
23 Commits
Author SHA1 Message Date
Thomas MartinandClaude Opus 5.5 6f2c0ee63a README rechecked: native is the default (no run_native.sh in the status or captions), every Challenge arena played and story levels 2-8 what is left, memory cards in %APPDATA%, no GS back end, the IOP kernel layer answered natively, generated_us/ and the disc's IOP modules in the diagram, Linux untested since the native work, requirements without bsdtar and pointing players at the launcher, the layout with make_release, the release workflow, CHANGELOG and LICENSE, credits to The Bozos and the fork's other ports; the European recompiler config and its last mentions removed
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 22:55:10 +01:00
Thomas MartinandClaude Opus 5.5 f5d47aea95 Merge the runner as a PC game (fork 21cfee6: ps2_app user folder, logs, crash reports, game data lookup; TMB: native by default, GUI exe with title and icon, FPS counter off) with the one-command build pipeline; README's script lines and RECOMP_NOTES keep both
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 19:37:02 +01:00
Thomas MartinandClaude Opus 5.5 c6b0163803 The runner as a PC game: native by default, user folder, game/ next to the exe, no console, log, crash reports (fork c4e7917)
A double-click on ps2EntryRunner.exe is now the full native port: TMB_NATIVE defaults to 1 (tmb::native::enabled and
the existing setEnvDefault block), so everything scripts/run_native.sh exports is a default; variables still win.
The fps counter is off (F3, PS2X_SHOW_FPS=1; run_native.sh sets it), scripts/run.sh sets TMB_NATIVE=0 to stay the
PS2 path. CMake names the app for the fork's ps2_app.h (title "Twisted Metal: Black", %APPDATA%\TMB_Recomp,
$XDG_DATA_HOME/tmb_recomp, game/SCUS_971.01) and builds the runner GUI-subsystem with runtime/app/tmb.rc (a
placeholder icon as GLFW_ICON, version information). Cards, input.ini, video.ini, imgui.ini, logs/ (last 3 runs)
and crashes/ in the user folder, the old cards and settings copied once. The mesh and texture packs fall back to the
file next to the ELF or the runner when the build's path is absent. README "As a PC game", RECOMP_NOTES.

Checked: a copy of the runner with game/ (disc files, ISO) beside it, started as Explorer starts it with only
PS2X_CAPTURE_WINDOW_DIR set: movies, menus, a Challenge match in Suburbs natively with sound, cards and video.ini
migrated, log written; arena.sh with main's runner, this one, and this one without the native variables: the same
menus (no fps counter now), matches native with the mixer playing, the terminal output unchanged and equal to the log;
PS2X_TEST_CRASH in a match: report and message box, addr2line resolving frame 0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 19:31:47 +01:00
Thomas MartinandClaude Opus 5.5 a8d4123210 tools/tmb_build.py: from the player's disc to a game folder in one command (Python standard library only, no bash, MSYS2 shell, bsdtar or rsync; the compiler a parameter)
verify (ISO9660 .iso / .bin / .cue, SYSTEM.CNF's BOOT2, SCUS_971.01's SHA-1; the European disc named as such) ->
extract (fork tools/ps2_disc.py, and the image as <game>/disc.iso: the game reads raw sectors too) -> tools ->
recompile -> packs -> iop (the IRX loaded offline at the bases recomp/tmb_iop_modules.json records, fork
tools/irx_load.py: byte-identical to the PS2X_IOP_DUMP_MODULES dumps, no boot) -> configure -> compile -> stage (the
DLLs from the PE import tables, Play TMB.cmd). PROGRESS / PERCENT / SKIP / DONE / ERROR / RESULT lines for a launcher,
resumable by step keys, logs per step. From an empty folder: 530 s; generated/ equal to main's generated_us/ (3576
files); the staged folder reaches a Challenge match at 59.5 fps with the nine native IOP modules.
scripts/iop_recomp.sh offline by default (--boot keeps the dump path and prints the bases), scripts/extract_iso.sh
without bsdtar. Fork 88a34e8 (native/build-pipeline). README "Build and run", RECOMP_NOTES section.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 19:19:29 +01:00
Thomas MartinandClaude Opus 5.5 3fd4544f12 The USA executable's addresses in runtime/: every hook (TMB_ADDR, TMB_GP), generated function name and region block rewritten to the USA executable's (from the region map tools/tmb_region_map.py made from the European one), the #if TMB_REGION_US blocks reduced to their USA side, tmb_region.h and the map tool gone; the build needs only the USA disc (scripts: the European region and its executable dropped; README and HANDOFF)
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 15:25:55 +01:00
Thomas MartinandClaude Opus 5.5 218c0c4e35 tools/tmb_mesh_pack.py: the 3D models (the NGP files' prebuilt VIF packets) converted once from the disc into a native mesh pack, keyed by file and object offset (pools, strips with material, normals, colours and texture coordinates; pool-less objects resolved to their pool; sprites, ribbons; the skinned meshes listed without geometry yet); run by scripts/recomp.sh, TMB_MESH_PACK
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 22:24:53 +01:00
Thomas MartinandClaude Opus 5.5 8449b801eb Textures from an offline native pack: no texture record, GS packet or GS memory read at runtime
tools/tmb_texture_pack.py converts the disc's .TEX (zip, raw deflate) and .RTX files and the ELF's font into a
native pack in the build tree (scripts/recomp.sh); a file's last record, whose size the game fills in when it
links the files, is sized from its format, and the car files' padding is left out. runtime/tmb_textures.cpp
follows TMB's texture code at hooks: which disc file goes where (fileReadf, zipInflateAll, file*TexFile,
file*ResFile), each texture's id as texmSetupTexture sets it up (the n-th setup is the pack's n-th record) and
each palette's or H texture's VRAM block as texmLoadResTexture loads it (sceGsSetDefLoadImage from there), both
checked against the pack's format and size; a draw's TEX0 finds its texture through the game's texInfo table
(TBP -> id) and its palette by CBP. The adapter hands it to the renderer (fork native/renderer 84ec62e:
Renderer::draw with the texture handed over). Shell and Junkyard: every record matched, no draw without its
texture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-31 13:47:34 +01:00
Thomas MartinandClaude Opus 5.5 d02bb7e69d Every IOP module recompiled; TMB_NATIVE=1 alone is the whole native port
scripts/iop_recomp.sh recompiles every module the game loads (989SND, LIBSD, PADMAN, SIO2MAN, MTAPMAN, MCMAN, MCSERV, USBD, LGDEV), for both releases: none left interpreted. With TMB_NATIVE=1 the overrides also set PS2X_IOP_NATIVE, PS2X_SPU2_WALLCLOCK and PS2X_IOP_WALLCLOCK by default (only scripts/run_native.sh did): the check runs measured the sound driver interpreted. Check runs, TMB_NATIVE=1 only: US 58.8 fps (p10 58.5), PAL 49.5 (p10 49.3), 9 modules native, nothing stuck or stalled.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 16:05:11 +01:00
Thomas MartinandClaude Opus 5.5 a9225e073d No more paraLLEl-GS with TMB_NATIVE=1: the GS stream goes to the fork's GS native back end
Menus, HUD, fonts, movies and the 3D now all draw through OpenGL, the native 3D in the same render targets at its GS markers. Fork a4c4819 (a target holding native draws covers the rows its scissor reaches: the 3D was black). US 58.9 fps mean, p10 58.5; PAL 49.4, p10 49.3. PS2X_GS_RENDERER=parallel or cpu keeps the emulated GS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 10:01:50 +01:00
Thomas MartinandClaude Opus 5.5 b76e054d2b The USA release (SCUS-97101, NTSC) alongside the European one, USA by default; native fixes
USA by default (TMB_REGION=us), PAL with TMB_REGION=pal: each region has its disc folder, recompiler config, generated code and build, and everything hand-written is shared.
- runtime/ marks the PAL addresses it uses (TMB_ADDR, TMB_GP); tools/tmb_region_map.py maps them to the region's executable by symbol (unnamed statics through the code using them) into tmb_region.h, with the generated function names and the override's registration (the override was only registered for SCES_503.60).
- recomp/tmb_manual.toml: the hand-written stubs by symbol name (tools/tmb_manual_toml.py); recomp/tmb_scus97101.toml generated.
- The disc image is the .iso that boots the executable; build_runtime.sh stages the DLLs on Windows; the scripts follow TMB_REGION.
- Native path: NTSC's 640 x 224 field (the microcode's half height is 112.0 there).
Native fixes, PAL and USA: the rigid strips' z / w scaled by VU 4.z as the microcode does (glows and smoke were cut by the scenery), VIF1's own STMASK/STROW/STCOL/STMOD seed the VU memory copy (the ribbons' inputs now match VU1 on 200 runs), the lens flares read the native frame's depth (TMB_NATIVE_FLARE_DEPTH=0 to compare), DIRECT packets that only draw can be drawn natively (none in a match), diagnostics.
Runs: USA boots, menus, story intro and a match at 57.4 fps on the PS2 path, 54.1 native; PAL unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-29 00:00:35 +01:00
Thomas MartinandClaude Opus 5.5 b7e28f68f5 README: the native port (game code, sound driver and VU1 microcode as native code, native renderer, sound on the PC clock); scripts/run_native.sh
What runs natively and what is still the PS2 path, part by part; the native switches; scripts/run_native.sh launches the native port (TMB_NATIVE, the recompiled sound driver when generated, the wall-clock SPU2 and IOP).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 19:49:48 +01:00
Thomas MartinandClaude Opus 5.5 ffe933a196 Native port: TMB's sound driver (989snd, libsd) runs as recompiled native code (PS2X_IOP_NATIVE=1)
The fork's tools/iop_recomp.py recompiles the IRX modules from the images the IOP loaded; scripts/iop_recomp.sh
boots the game to dump them and writes generated/iop/ (derived from the game's IRX files, never committed, as
generated/), which the build compiles into its own object library. Match run with them native: 49.8 fps, no stall;
the sound matches the interpreted run's recording where the runs are the same (boot and menus).

Fork bumped to native/renderer 1e08a79 (IOP recompilation, blocking imports in native code).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 11:54:10 +01:00
Thomas MartinandClaude Opus 5.5 721756befd scripts/recomp.sh: TMB_VU1_EXACT unset is not an error under set -u
common.sh runs the scripts with set -u, so the test stopped the script after ps2_recomp, before the VU1 microcode and
the copy into generated/.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:32:37 +01:00
Thomas MartinandClaude Opus 5.5 3d178c2158 Port regression run, frames over 25 ms in the trace, enemy cap from TheGame's vehicle array, god mode, fill A/B
- scripts/regress.sh <build-dir> <out-dir>: the fork's port regression run for TMB (boot movies, menus, a
  Skyscrapers match under the bench lock), summary.txt in the shared key=value format (tools/regress_summary.py),
  last_frame.png. First run: route reached, 49.2 fps mean, p10 48.3, no error.
- tools/arena_script.py: the Challenge-mode pad script, from the scratchpad into the repo.
- TMB_TRACE_FRAMES lines count the frames over 25 ms in each window of 100.
- TMB_ENEMY_HEALTH_CAP walks TheGame's vehicle array (TheGame + i * 0x2D00, count at +0x1B3DB4, as
  TheGame::GetVehicleFromName) instead of assuming a contiguous one; not run through story mode yet.
- TMB_PLAYER_GOD=1 keeps the player car at its highest health seen.
- TMB_AB=fill: the GS drawing-time model at 8 against 4 pixels per GS cycle (neutral on TMB).
- Notes: the rear view draws the scene twice; the CPU renderer on main and gs/gpu-renderer's CPU path; Prison
  Passage can't be picked in Challenge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-27 15:11:31 +01:00
Thomas MartinandClaude Opus 5.5 67d7d75dfb Fast VU1 path on by default (45 against 41-43 fps in play); rain microprogram studied for lifting
scripts/recomp.sh generates the VU1 microcode with PS2X_VU_AOT_FAST=1 (TMB_VU1_EXACT=1 for the exact model).
Four alternated play runs: fps mean 45.0/45.3 against 41.0/43.0, worst tenth 35.5/39.4 against 27.3/33.4,
VIF1 thread ~10 ms a frame against ~12.5; same pictures, no freeze.

tools/vu_disasm.py disassembles VU microcode. The hottest program (pc 0x1d40, a third of VU1's cycles) is the
rain: 16000 drops a frame, 3.3 ms on the fast path; notes on lifting it to native code.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 22:30:29 +01:00
Thomas MartinandClaude Opus 5.5 bc06b8e53e GPU renderer by default; timeline marks vblanks; opt-in PGO; README status
- The GS draws on the GPU (paraLLEl-GS) unless PS2X_GS_RENDERER=cpu: 20-23 ms per frame in the match against
  24-27 with the CPU rasterizer. Without a Vulkan device it falls back to the CPU by itself.
- TMB_TRACE_TIMELINE: the GS thread is GSFrontend since the sc3 backport, and every vblank is marked from the
  scheduler's tick (the vblank handler only runs during movies). The match is bound by VIF1/VU1, with the GS
  thread following it and the game thread waiting for both.
- TMB_PGO=GENERATE|USE and scripts/pgo.sh: profile-guided build of the runtime, IOP and compiled VU1 microcode.
  The VU1 replay is ~12% faster; no measurable gain in the game yet, so it stays opt-in.
- tmb_vu1_replay takes PS2X_PROFILE on Windows.
- README: the status is ~40 fps with sound, on Linux and Windows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-26 07:01:25 +01:00
Thomas MartinandClaude Opus 5.5 30f9c2012c Fork bump: 124 of sc3-port's commits backported (recompiler, kernel, DMA, GS, IOP fixes)
Arzaroth's sc3/bringup (Soulcalibur III) on top of our fork, without its VU1 rework (it drops our per-fragment
VU1 AOT), its pad script parser and the cores-2 raster default. 546 fork tests pass, TMB reaches the match with
0 falls in the bots match; about 10% slower per frame, not investigated yet. RECOMP_NOTES lists what came in.

scripts/stage_dlls.sh: DLLs staged by an earlier run are refreshed and counted too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 20:17:19 +01:00
Thomas MartinandClaude Opus 5.5 3c72200a43 Windows: native build with MSYS2 UCRT64, movie skip no longer hangs; fork bump
- runtime/tmb_host.cpp: the thread CPU times behind TMB_TRACE_FRAMES and TMB_TRACE_TIMELINE (/proc and
  clock_gettime on Linux; Toolhelp32, GetThreadDescription and QueryThreadCycleTime on Windows) and setenv.
  Outside the unity batches and the PCH: <windows.h> clashes with raylib.
- scripts/stage_dlls.sh copies the MinGW and FFmpeg DLLs next to ps2EntryRunner.exe.
- .gitattributes keeps the scripts LF where git converts line endings.
- Skipping the copyright movie hung the game: after videoDecAbort, updateMpegMovieDecoding loops on
  switchThread (RotateThreadReadyQueue(1), written for ezmpeg's priority-1 main loop) at priority 0, and the
  priority-1 decode thread never ran to acknowledge. switchThread now drops a priority-0 caller to
  priority 1 for the rotation and restores it when it runs again.
- Fork bump: Windows build fixes (FFmpeg via pkg-config on MinGW, x86 flags, raylib before winmm).

Menus, movies and the first match run on Windows, with the CPU rasterizer and with paraLLEl-GS.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 18:52:30 +01:00
Thomas MartinandClaude Opus 5.5 a0e7bdc4ca No more falling through the ground: game update once per vblank field; fork bump: VU0 macro memory ops
The cars move by their velocity times the vblank fields since the previous frame and test the collisions once,
after the move. The PS2 runs the match at one field per frame; at the 2-4 fields of a slow host each step went
2-4 times as far and fast cars landing on a slope went under it. TheGame::Update now runs once per field (at
most TMB_SUBSTEPS, default 4), the fields, update rate and frame time split over the steps, each step returning
through the dispatcher to a padding address that starts the next one. Bots scenario (scripts/bots.sh, player
idle, 10 min): 11 falls under the arena in 19371 vblanks before, 0 in 25857 after, no measurable cost.
TMB_TRACE_POS traces every vehicle.

Fork: the macro VU0 VLQI/VSQI/VLQD/VSQD used EE RAM instead of VU0 data memory and VSQI swapped its fields
(TMB's matrix stack wrote vf10 three times into low EE RAM); VDIV by zero gives +-max.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-25 01:42:22 +02:00
Thomas MartinandClaude Opus 5.5 867519ee86 VU1 microcode compiled ahead of time, GS rasterization on 4 workers, real match speed
- scripts: build_tools.sh builds ps2_vu_aot, recomp.sh writes the compiled
  VU1 microcode to generated/vu1/ (-O3, no debug info, outside the unity
  batches); tmb_vu1_replay checks it against recorded runs.
- runtime/tmb_overrides.cpp: GS rasterization on 4 worker threads
  (TMB_GS_SERIAL=1 keeps the GS thread alone).
- README/notes: the earlier 26 fps was a near-empty view; the match runs at
  10-13 fps, bound by the rasterizer.
- Fork bump: VU1 inline semantics, exact fast FMAC flags, ps2_vu_aot.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-23 13:47:17 +02:00
Thomas MartinandClaude Opus 5.5 358f93e73b Movies play through, title screen reached
- videoCallback stubbed (ret1): its viBuf copy only feeds the IPU, which
  the libmpeg HLE replaces; the full ring made videoDecFlush spin
- videoDecAbort override ends the HLE playback on movie skip
- fork bump: program end code ends HLE movies, abortMpegPlayback
- TMB_TRACE_MOVIE=1 movie player diagnostics
- recomp.sh stages output and rsyncs by content (incremental rebuilds)
- tools/iso_lbn.py maps disc sectors to files
- notes and README status

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-22 23:02:14 +02:00
Thomas MartinandClaude Fable 5.1 320f7e9d8d Match the VP2S/Drakengard layout and README style
- recomp/ for the recompiler config, runtime/ for the override module
- README in the sibling ports' style: disc hash, milestones, how it works,
  build and run, options, layout, credits
- docs/RECOMP_NOTES.md bring-up log
- drop the MIT LICENSE: the port links the GPL PS2Recomp runtime, as the
  sibling projects do
- submodule bump: GCC/Clang -march fix in the fork

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-22 20:56:43 +02:00
Thomas MartinandClaude Fable 5.1 9bcf67c36e Initial project: Twisted Metal Black (SCES-50360) recomp scaffold
- PS2Recomp fork as submodule
- analyzer-generated recompiler config for the PAL ELF
- top-level CMake linking generated code into ps2EntryRunner
- helper scripts for extract/analyze/recomp/build/run
- game override stub

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-10-22 20:52:11 +02:00