The Xbox game now runs as a native Windows program through its whole front end. Intro movies, title, main menu, VIP creation and save, Team Select with 3D helmets, and Coach Matchup all work, and a Quick Game now gets into the match: the stadium, the players, the crowd and the coin toss all render in 3D, with sound running. It currently stops at the coin toss.
RECOMP_GPU=1. Menus about 4x faster.WorkingThree fixes took the game from a black loading screen to the coin toss:
The game plays the pregame speech and waits for it to finish. The Xbox audio chip reports that with an interrupt, and the port never delivered it. The game's own audio interrupt handler now runs, and loading completes.
24 small game routines had never been translated. One of them made a menu draw garbage until it crashed. A second translator bug turned a one-case switch into a jump nowhere once the audio started working.
The game uses "W-buffered" depth, measuring distance with a different value than the port assumed. Most of the 3D scene, and the on-screen graphics, were being hidden behind things they're in front of.
Until now every pixel was drawn by the CPU. The port now has a Direct3D 11 renderer: the game's vertex programs still run on the CPU, but drawing, texturing, the Xbox's colour-combining stage, transparency, depth and stencil all run on your graphics card (tested on an RTX 2060 SUPER). The picture matches the software renderer. The only visible change is smoother texture filtering.
Same 75-second run: 573 screen refreshes with software rendering, 2,348 with the GPU. It's now the default; set RECOMP_GPU=0 to go back to software.
After Start Game the game shows its matchup loading screen: the team names cycle along the top edge while everything else fades out. Both renderers show exactly the same thing, so this isn't a drawing bug. The game is still loading. Loading stalled because the game stops a sound and waits for the audio chip to confirm it stopped. The audio chip isn't emulated yet, so no confirmation ever came. That wait is now bounded, and loading gets about 440 disc reads further before the next stall, which is being traced now.
Since the first pictures, the port has gone from movies to the full front end and into a match. Each step below removed a blocker you could see:
One small game routine (returning a number used to lay out a menu) was never translated. The menu read garbage, tried to draw far too much, and ran out of memory. Twelve more missing routines, found by scanning the game's function tables, were added at the same time.
The Xbox graphics chip runs a small program for every vertex of every shape, even for flat menus. The port can now run those programs, with depth sorting and perspective-correct textures. That's what draws the 3D helmets, the ESPN studio and the stadium.
The chip's final colour stage (how textures, lighting and fades combine) is now emulated, and a wrong register address that gave almost every texture the wrong colours is fixed.
Drawing now runs on its own thread. Before, it held up the screen-refresh signal the game paces itself on, and the game dropped to about 4 frames a second.
The thread that generates screen refreshes was running a loading callback that itself waited for a screen refresh, so it waited on itself forever. Loading work is now kept off that thread, as on real hardware.
A bad drawing command, or the window following an off-screen image, used to take the whole game down. Both are now skipped safely.
Yes. Nothing in the window is a video file made for the port. The movies are the game's own files from the disc image. The game's own MPEG decoder (CRI Sofdec, translated from the Xbox code) decodes them, and the game's own drawing code puts each frame on screen. The port's graphics layer then carries out those drawing commands and shows the result in the window:
If a frame ever looks wrong (grey fill, missing layers), that comes from the port's graphics layer, which is still incomplete. It doesn't mean the footage is fake.
NFL2K5.exe's window, 36 seconds after launch.There was no single fix. Five problems formed a chain, and each one hid the next, so each had to be solved before the next could even be seen. The one that finally put pictures on screen was number 3: before it, not one of the game's draw commands had ever been carried out.
The game's MPEG decoder keeps its frame-decoding routines in separate code sections and reaches them only through tables of addresses. The translator never found them, so every frame decode called into nothing. They're now included in the translation.
The game waits for the Xbox's 60 Hz refresh signal before each frame. A background helper in the port kept erasing that signal before the game could see it, so the game noticed about one refresh a second. With the movie running at one frame a second, nothing looked alive. Now the signal stays set until the game acknowledges it, the way real hardware behaves.
A first version of this fix locked the game up. The port lets only one game thread run at a time, and that version could leave two threads each waiting on the other. It was redesigned so that can't happen.
The game writes its drawing commands into a large buffer and points the graphics chip at it with jump instructions. The port's command reader stopped at the first jump, so it never reached a single draw. Every earlier run reported zero draws. Once the reader followed jumps and calls the way the GPU does, draws started running. This affects everything the game draws, not just the movies.
Once draws were running, the port's graphics layer had its own mistakes. Vertex data was read with the wrong layout, which collapsed everything onto the left edge. Triangles were joined in the wrong order, leaving a triangle-shaped hole. Paletted images weren't supported, so the SEGA logo came out grey. Transparency wasn't supported either, so a see-through fade layer was painted as solid grey over the movie. All of these are fixed.
The window used to show whichever image was mid-redraw, which flickered. It now shows each frame once the game marks it finished. Double-clicking NFL2K5.exe also turns on the settings rendering needs, which only the test script used to set. That script starts the window hidden.
Not diagnosed yet. The error dialog seen during testing came from ShellHost.exe, a Windows process, not from the game, which would name NFL2K5.exe. The game window stayed open behind it showing grey. So the game may have hung or gone grey rather than crashed. The next step is a run with logging captured to see where it stops.
The attract-mode demo is real gameplay, so it likely needs the same loading to finish that Start Game does. Vertex programs (3D) are now implemented.
Audio hardware is stubbed. In some test runs, after the first movie ended, the player kept showing a grey, never-decoded frame. The likely cause is that it waits for the movie's audio to finish, and silent audio never reports finishing. Your run got further than that, so the behaviour varies.
The current build is unoptimised and runs the Xbox's single CPU thread-by-thread under a lock. GPU rendering (RECOMP_GPU=1) takes drawing off the CPU; the game code itself is still built without optimisation.
Run it with no arguments; GPU rendering is on by default. The intro plays unless the environment variable NFL2K5_SKIP_INTRO=1 is set. tools\run-bringup.ps1 launches with the window hidden and is meant for diagnostic logs.