<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2026-10-21T14:46:11+00:00</updated><id>/feed.xml</id><title type="html">icex2’s blog</title><subtitle>Hacker and software engineer, operating systems, distributed systems, (arcade) video game hacking and reverse-engineering.</subtitle><entry><title type="html">LLM assisted source lifting and game porting (3): Two games, one workflow, and what runs today</title><link href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/19/llm-assisted-source-lifting-and-game-porting-3.html" rel="alternate" type="text/html" title="LLM assisted source lifting and game porting (3): Two games, one workflow, and what runs today" /><published>2026-10-19T18:00:00+00:00</published><updated>2026-10-19T18:00:00+00:00</updated><id>/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/19/llm-assisted-source-lifting-and-game-porting-3</id><content type="html" xml:base="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/19/llm-assisted-source-lifting-and-game-porting-3.html"><![CDATA[<p>This is the third post in the series. The <a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-1.html">first post</a> is the high-level introduction; the <a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-2.html">second post</a> is the technical deep dive into the workflow. This one is a progress report: what the two ports do today, what broke on the way, which problems I caught and which the tooling caught, and what the work has cost so far.</p>

<div style="display:flex;flex-wrap:wrap;gap:1rem;margin:1.5rem 0;">
  <figure style="flex:1 1 300px;min-width:0;margin:0;">
    <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/01-ddr-title.png" alt="The DDR EXTREME title screen in the native runtime" style="display:block;width:100%;height:auto;" />
    <figcaption style="font-size:0.9em;opacity:0.75;">DDR EXTREME title screen.</figcaption>
  </figure>
  <figure style="flex:1 1 300px;min-width:0;margin:0;">
    <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/11-iidx-title-screen.png" alt="The beatmania IIDX 9th style title screen in the native runtime" style="display:block;width:100%;height:auto;" />
    <figcaption style="font-size:0.9em;opacity:0.75;">beatmania IIDX 9th style title screen (including some unfixed visual glitches at the bottom).</figcaption>
  </figure>
</div>

<p><b>Both captures are from current development builds of the still work-in-progress lifted source code.</b></p>

<h2 id="a-word-on-llm-assisted-writing">A word on “LLM-assisted writing”</h2>

<p>This post was written with the support of an LLM. However, this here, is actually me, the human writing this section to be transparent about it. I did review
this post prior publishing and also tweaked several things by hand.</p>

<p>My goal is to share the ideas, principles and concepts that I applied in these projects. I believe this knowledge can benefit similar use-cases, and in general help others in figuring out how to make hopefully better use of LLMs in doing great and meaningful things.</p>

<p>LLMs didn’t make writing this post possible, but rather lowered the bar for me to spend that extra time and effort in getting this out. I hope the result, no matter how and who/what wrote it, is what counts and achieves on the knowledge sharing aspect. Because in the end, that’s what I believe does actually matter.</p>

<h2 id="a-note-on-the-screenshots">A note on the screenshots</h2>

<p>All screenshots in this post are from development builds of the lifted source code unless noted otherwise. Their runtimes still contain visual bugs and glitches, and several screens have not received another bugfix or fidelity pass. From a progress perspective, a screenshot shows that a screen is reachable and that a path works; it is not a claim that the screen is finished, yet. The captions call out known defects where they matter.</p>

<h2 id="the-short-version">The short version</h2>

<p>Dance Dance Revolution EXTREME now plays a complete three-stage Beginner session in the native runtime with the source lifted game code, from the title screen through song selection, gameplay, results, the ending, and back to attract. It also supports the entire attract loop and test/operator menu. The code doing that is reconstructed C running on native platform services, driven by real inputs.</p>

<p>beatmania IIDX 9th style now boots through the entire startup sequence to the first warning screen, full attract loop, title screen and starting a session, card entry, mode select, options, the song list, and the confirmation screen. It stops at the pre-gameplay fade. There is no IIDX (main) gameplay yet.</p>

<p><strong>There is no public build and no date for one at this stage.</strong></p>

<p>More updates follow as development progresses and when I decided how to publish any tooling or releases of the projects.</p>

<h2 id="ddr-extreme-one-player-session-start-to-finish">DDR EXTREME: one player session, start to finish</h2>

<p>The interesting unit of progress is not a function count or a screenshot. It is a player’s game session that starts at the title screen, accepts inputs, and reaches a natural end/game over.</p>

<p>The latest retained run did that. A 1,165-command script supplied canonical cabinet inputs; the runtime advanced exact frames and captured checkpoints. The script played three Beginner stages and finished after advancing 34,525 game frames/ticks.</p>

<div style="display:flex;flex-wrap:wrap;gap:1rem;margin:1.5rem 0;">
    <figure style="flex:1 1 300px;min-width:0;margin:0;">
      <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/03-ddr-song-wheel.png" alt="DDR Extreme main music select screen with song wheel." style="display:block;width:100%;height:auto;" />
      <figcaption style="font-size:0.9em;opacity:0.75;">DDR Extreme main music select screen with song wheel. Some slight visual artifacts near the groove radar's "AIR" and "FREEZE" attributes and to the right of the song banner</figcaption>
    </figure>
    <figure style="flex:1 1 300px;min-width:0;margin:0;">
        <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/04-ddr-results.png" alt="DDR Extreme song result screen of the final stage (out of 3 total stages/songs) on beginner difficulty." style="display:block;width:100%;height:auto;" />
        <figcaption style="font-size:0.9em;opacity:0.75;">DDR Extreme song result screen of the final stage (out of 3 total stages/songs) on beginner difficulty</figcaption>
    </figure>
  <figure style="flex:1 1 300px;min-width:0;margin:0;">
    <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/02-ddr-gameplay-beginner.png" alt="DDR Extreme main gameplay on beginner difficulty." style="display:block;width:100%;height:auto;" />
    <figcaption style="font-size:0.9em;opacity:0.75;">DDR Extreme main gameplay on beginner difficulty reached from the reconstructed application, after 6,979 game frames/ticks. Visual glitches with additional arrows rendered at the top and bottom of the main gameplay area</figcaption>
  </figure>
</div>

<p>That establishes a connected path, not parity, as evident by the visual artifacts. The run is a native diagnostic with deterministic inputs and retained artifacts. It does not by itself prove that the original arcade board would produce the same pixels, the same audio, or the same timing at every step. The next section is about why that distinction matters and what it takes to make a claim smaller and more useful.</p>

<p>The ordinary launcher also runs the full attract loop and test/operator menu without the control session, so the application is not only usable under a game-loop debugger.</p>

<h2 id="what-exact-means-here-for-visual-output">What “exact” means here for visual output</h2>

<p>A screen can look convincing and still contain rendering errors. For a visual comparison, I can make “exact” more concrete: at a particular checkpoint, do the reconstructed runtime and the original game produce the same pixel values? That is a much narrower question than whether the whole port is faithful, but it is one the tooling can answer.</p>

<p>For DDR, the reference is the original game running in MAME. Lua scripting provides controls on that side, while the native runtime exposes corresponding game-loop debugger controls. These let the agent supply inputs, advance execution, and capture output for comparison. An automated pixel comparison then measures differences that a side-by-side inspection might miss.</p>

<p>The useful part is the investigation this enables. In one comparison, correcting the operator-text rendering reduced the differences but did not eliminate them. A suspected display-mode issue was tested and made no difference. Further investigation showed that some captures had been taken after entering the screen under different display conditions. Those captures were not a valid like-for-like test: changing the renderer to make them match would have been chasing the wrong problem.</p>

<p>Once that setup was corrected, the compared image matched pixel for pixel outside a deliberately excluded footer containing version and machine-identity information that differed between the two runs. The comparison also accounted explicitly for the two runtimes’ different pixel representations. Neither step was permission to blur away rendering errors.</p>

<p>That is what “exact” means in this example: the same pixel values in the compared region, at the selected checkpoint, under the stated comparison conditions. It does not establish matching audio, input timing, other screens, or the picture produced by a physical arcade board. The reference here was MAME’s selected video-memory image, not a measurement of the cabinet’s display.</p>

<p>The agent’s value was not simply judging whether two screenshots looked alike. The tooling gave it a way to investigate differences, test hypotheses, and measure the outcome—including discovering when the comparison itself was misleading.</p>

<div style="display:flex;flex-wrap:wrap;gap:1rem;margin:1.5rem 0;">
    <figure style="flex:1 1 300px;min-width:0;margin:0;">
      <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/06-ddr-comparison.png" alt="A matched checkpoint used for comparison: original runtime (left) and native runtime (right)." style="display:block;width:100%;height:auto;" />
      <figcaption style="font-size:0.9em;opacity:0.75;">A matched checkpoint used for comparison: MAME runtime (left) and source lifted runtime (right). Notice the visual artifacts near the groove radar's "AIR" and "FREEZE" attributes and to the right of the song banner</figcaption>
    </figure>
</div>

<h2 id="defects-and-who-caught-them">Defects, and who caught them</h2>

<p>I care about who or what caught a defect because it says something about the workflow. A human noticing a broken screen is valuable but expensive. A runtime or comparison tool used by an automated agentic workflow catching the same class of problem is “cheaper” and repeatable. The goal is to move defects from the first category to the second without pretending that either category disappears.</p>

<h3 id="what-i-the-human-caught">What I, the human, caught</h3>

<h4 id="code-path-defect-that-didnt-matter-to-the-agent">Code path defect that didn’t matter to the agent</h4>

<p>The source-lifted IIDX application produced a black screen and appeared stuck after pressing Start at the title. The agent had created separate startup paths for its controlled runs and the normal application launcher. Its specialized path worked, but the normal entry point had not been connected correctly. I hadn’t tested the application myself until then, so this gap survived the agent’s checks. After I encountered it, a brief code review and feedback were enough for the agent to correct it. Testing the game through a development interface had not established that launching it normally worked.</p>

<h4 id="different-rendering-modes">Different rendering modes</h4>

<p>DDR had a different kind of gap. The test menu appeared as a small image in the middle of the window, while the title screen’s credit counter was misplaced near the center. I pointed out that the original game switches between low- and high-resolution rendering (320x240p and 640x480i modes), and suggested investigating whether those mode changes explained the symptoms.</p>

<figure style="max-width:640px;margin:1.5rem auto;">
  <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/13-ddr-test-menu-wrong-render.png" alt="DDR test menu before correction, with small text confined to the center of the window" style="display:block;width:100%;height:auto;" />
  <figcaption style="font-size:0.9em;opacity:0.75;">Test menu before correction: low-resolution content occupies only the center of the window.</figcaption>
</figure>

<p>That gave the agent a concrete direction, but it wasn’t the diagnosis by itself. The investigation found two reconstruction mistakes: leaving attract mode updated the wrong resolution field, and the credit-text code read a separate field that did not track the frame’s actual mode. Correcting those paths restored the menu’s full-window presentation and the title credits’ placement, which I then checked visually. We had initially discussed changing the port’s resolution handling, but that turned out not to be necessary for these defects—the reconstructed code needed to preserve the original behavior correctly.</p>

<div style="display:flex;flex-wrap:wrap;gap:1rem;margin:1.5rem 0;">
  <figure style="flex:1 1 300px;min-width:0;margin:0;">
    <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/15-ddr-title-credit-text-bug.png" alt="DDR title screen before correction, with small credit counters misplaced over the logo" style="display:block;width:100%;height:auto;" />
    <figcaption style="font-size:0.9em;opacity:0.75;">Before: the credit counters use the wrong size and position, appearing over the logo.</figcaption>
  </figure>
  <figure style="flex:1 1 300px;min-width:0;margin:0;">
    <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/01-ddr-title.png" alt="DDR title screen in a later development build, with correctly sized credit counters along the bottom" style="display:block;width:100%;height:auto;" />
    <figcaption style="font-size:0.9em;opacity:0.75;">After: a later development capture shows the correctly sized credit counters along the bottom.</figcaption>
  </figure>
</div>

<h4 id="incorrect-texture-addressing">Incorrect texture addressing</h4>

<p>On the Dancemania screen which is part of the attract loop, the artwork appeared repeated and discontinuous. Investigation with the actual image resource found that the reconstructed renderer calculated the texture-page origin incorrectly. PlayStation texture addressing combines a page location with coordinates inside that page; getting that relationship wrong made the native renderer read a different part of the artwork. Understanding the original graphics conventions mattered here, even though the replacement renderer ran on modern hardware. That established a concrete defect, but did not by itself prove that every discontinuity in the screenshot had been resolved.</p>

<div style="display:flex;flex-wrap:wrap;gap:1rem;margin:1.5rem 0;">
  <figure style="flex:1 1 300px;min-width:0;margin:0;">
    <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/14-ddr-dancemania-bug.png" alt="DDR Dancemania attract screen with repeated and discontinuous artwork" style="display:block;width:100%;height:auto;" />
    <figcaption style="font-size:0.9em;opacity:0.75;">Dancemania: artwork repetition and discontinuities. Investigation found an incorrect texture-page calculation in the reconstructed renderer.</figcaption>
  </figure>
</div>

<h4 id="when-several-defects-combine">When several defects combine</h4>

<p>The ranking screen was not one isolated graphics bug. Its reconstruction had incomplete font handling and used the wrong drawing method for the background: a single wrapping primitive where the original split the image across texture pages. A later investigation also found that it selected artwork from assumed resource slots instead of resolving it through the game’s shared resource map. Earlier screens could change those allocations, leaving the ranking renderer drawing valid—but unrelated—image data. Correcting text rendering alone therefore did not fix the screen: the connected resource-loading path mattered too. These were defects found during the investigation, not proof that each stripe in the earlier screenshot had the same cause. Interlace handling was an early hypothesis, not an established explanation.</p>

<div style="display:flex;flex-wrap:wrap;gap:1rem;margin:1.5rem 0;">
  <figure style="flex:1 1 300px;min-width:0;margin:0;">
    <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/16-ddr-ranking-glitched.png" alt="DDR ranking screen obscured by severe cyan, magenta, and black striped rendering corruption" style="display:block;width:100%;height:auto;" />
    <figcaption style="font-size:0.9em;opacity:0.75;">Ranking screen: severe rendering corruption. The investigation uncovered separate drawing, font, and resource-binding defects—not a confirmed interlace problem.</figcaption>
  </figure>
</div>

<p>These cases show why “LLM-assisted” is an important distinction. I supplied observations from actually running the game, context about its original display behavior, and direction about which failures mattered. The agent then used the binary, original resources, tests, and runtime comparisons to investigate those reports. My resolution-mode suggestion helped focus the menu and credit-text investigation, but it was a hypothesis to test—not an instruction to make every rendering problem fit the same explanation.</p>

<p>The tooling’s coverage also shaped what the agent could establish. A successful build or an isolated screen test did not prove that the normal application path worked, that earlier screens had left the right resources available, or that the rendered output matched the original. Human feedback helped expose those gaps and steer the next experiment; repeatable checks then made the supported corrections verifiable. The useful division of work was not just me spotting defects and the agent fixing them: I helped choose the relevant path and question, while the agent investigated the evidence and tested the answer.</p>

<h3 id="what-the-runtime-caught">What the runtime caught</h3>

<p>A scripted DDR session initially stopped after the second stage. Another run reached the ending but aborted because an ending resource, was not connected through the reconstructed loading path. These were integration gaps: individual screens could work while the transitions and resource loading needed for a complete session were still incomplete.</p>

<p>Running the game through a full session gave the agent a repeatable way to encounter those gaps, investigate where execution stopped, and replay the affected path after a correction. The later run completed all three stages, showed the ending, and returned to attract. That verified the exercised sequence—not every possible session—but it covered behavior that testing screens individually would miss.</p>

<p>The same approach also exposed a defect in the testing interface itself. The game completed the scripted inputs, but an undersized response buffer prevented the controller from receiving the completion status. The failure was in the tooling, not the game. Reliable runtime feedback depends on checking that distinction rather than treating every failed script as a reconstruction defect.</p>

<h3 id="what-the-comparison-tooling-caught">What the comparison tooling caught</h3>

<p>The image comparisons helped the agent measure whether rendering corrections actually reduced the differences. They also prompted an investigation into whether the two runs were comparable in the first place. In one case, the native capture had inherited a different display configuration, so the apparent rendering mismatch was partly a setup problem. The correct response was to fix the comparison conditions, not change the renderer to compensate.</p>

<p>The reference capture needed scrutiny too. At one checkpoint, MAME’s screenshot still showed the previous screen even though the selected image in video memory had already advanced. Inspecting that buffer exposed the discrepancy. For that comparison, the reference became the selected video-memory image, with the limitation that this checked rendered content rather than the final display output.</p>

<p>The useful feedback was therefore more than a count of different pixels. Captures and runtime observations gave the agent a way to distinguish a reconstruction defect from a mismatched scenario or an unsuitable reference.</p>

<h3 id="what-static-analysis-caught">What static analysis caught</h3>

<p>A broken IIDX mode-select screen came from loading the wrong asset set. The reconstructed code selected a neighboring resource descriptor, bringing in artwork and animation data of the main gameplay screen instead of the intended mode select screen. The data was valid enough to render and not crash the application, so the application drew unrelated artwork just fine and even menu selection mechanics were actually working and controllable with player inputs.</p>

<p>Comparing the reconstructed resource-selection code with the original binary identified the wrong descriptor. That explained why the screen could run while still being incorrect: successful loading did not mean the right data had been loaded.</p>

<p>This is where static analysis complements runtime testing: the rendered screen exposes the symptom, while tracing the original code and data can establish why it happened.</p>

<figure style="max-width:640px;margin:1.5rem auto;">
  <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/08-iidx-mode.png" alt="IIDX mode-select screen before the resource-selection correction, displaying unrelated artwork" style="display:block;width:100%;height:auto;" />
  <figcaption style="font-size:0.9em;opacity:0.75;">Mode select before the resource-selection correction. The mode9/bank21 selection is corrected in source; a fresh post-fix capture and the mode-label rendering remain outstanding.</figcaption>
</figure>

<p>The lesson is not “the agent was careless”. The lesson is that a plausible-looking lookup that resolves to the wrong bank is exactly the kind of defect that a rendered screen can hide, and that a regression tied to the original descriptor is what makes the correction durable.</p>

<h2 id="iidx-the-first-visible-path">IIDX: the first visible path</h2>

<p>IIDX is slightly behind DDR as I started that project after I reached a high degree of agentic automation with DDR, and also figured out several important fundamentals that I could apply to IIDX immediately.
However, everything from initial startup/boot to the screens on the screenshots is working regarding rendering, sound and inputs.</p>

<p>Since I already covered various LLM-related aspects with DDR above, the following is simply a few screenshots showing progress and also a few more defects.</p>

<div style="display:flex;flex-wrap:wrap;gap:1rem;margin:1.5rem 0;">
<figure style="flex:1 1 300px;min-width:0;margin:0;">
  <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/10-iidx-attract-intro.png" alt="IIDX attract loop game intro sequence" style="display:block;width:100%;height:auto;" />
  <figcaption style="font-size:0.9em;opacity:0.75;">IIDX attract loop game intro sequence.</figcaption>
</figure>

<figure style="flex:1 1 300px;min-width:0;margin:0;">
  <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/12-iidx-title-options-glitch.png" alt="IIDX Options menu on the title screen once coins are inserted" style="display:block;width:100%;height:auto;" />
  <figcaption style="font-size:0.9em;opacity:0.75;">IIDX Options menu on the title screen once coins are inserted and before starting the game session. The menu is visibly glitched;</figcaption>
</figure>

<figure style="flex:1 1 300px;min-width:0;margin:0;">
  <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/07-iidx-card-entry.png" alt="IIDX Card entry screen" style="display:block;width:100%;height:auto;" />
  <figcaption style="font-size:0.9em;opacity:0.75;">IIDX Card entry screen.</figcaption>
</figure>

<figure style="flex:1 1 300px;min-width:0;margin:0;">
  <img src="/assets/2026-10-19-llm-assisted-source-lifting-and-game-porting-3/09-iidx-song-select.png" alt="IIDX Music select screen with song wheel" style="display:block;width:100%;height:auto;" />
  <figcaption style="font-size:0.9em;opacity:0.75;">IIDX Music select screen with song wheel.</figcaption>
</figure>
</div>

<h2 id="what-works-as-of-october-1819-2026">What works as of October 18–19, 2026</h2>

<p>This is the snapshot for this article, not a rolling list of later progress. “Works” means the listed screen or feature is connected and exercised within the described scope; it does not mean every mode is complete or every visual and audio detail matches the original.</p>

<h3 id="dance-dance-revolution-extreme">Dance Dance Revolution EXTREME</h3>

<ul>
  <li><strong>Attract mode:</strong> warning and logo screens, Dancemania artwork, the title screen, How To Play, demonstration gameplay, BEST RANKING, hidden-element availability, and Memory Card Information. The ordinary launcher runs the repeating sequence without a debugger directing screen changes.</li>
  <li><strong>Credits and controls:</strong> coin and service credits, Start, menu navigation, and player dance-panel inputs, with keyboard mappings for both players. Input controls work across the implemented screens, including the game menus, song selection, gameplay, and test/operator menu. Having both sets of controls does not establish a complete two-player game.</li>
  <li><strong>Starting a game:</strong> the title-to-game menus and song-selection wheel, including browsing and confirming a song on the demonstrated Beginner route.</li>
  <li><strong>Beginner gameplay:</strong> a complete three-stage session with scrolling arrows, input judgments, score and combo tracking, and progression from one song to the next. The retained end-to-end run uses scripted inputs, rather than establishing every song, difficulty, or play mode.</li>
  <li><strong>Results and game completion:</strong> individual stage results, Total Result, ending credits, and return to attract mode after the third stage. The failed-session return path is also connected.</li>
  <li><strong>Test/operator menu:</strong> the main menu and settings/check screens, including game and coin options, bookkeeping, sound options, and memory-card options. Sound options supports playback, cancellation, and return/re-entry; memory-card options works in the native no-card-inserted scenario, not as real card read/write support. Cabinet-check screens are not proof of physical arcade hardware operation.</li>
  <li><strong>Audio:</strong> attract playback, fades, and silence behavior are connected, including the attract-sound setting and its once-every-four-cycles policy. Audio verification was still lagging behind the screen and input work at this point; comprehensive playback and fidelity verification across the implemented game flow remained outstanding.</li>
</ul>

<h3 id="beatmania-iidx-9th-style">beatmania IIDX 9th style</h3>

<ul>
  <li><strong>Startup and attract screens:</strong> boot/loading and system checks, the warning and title screens, and the reconstructed attract sequence, including How To Play/demo and ranking paths. Coverage includes connected component tests; it is not a claim that every attract branch has been visually verified in the full application.</li>
  <li><strong>Credits and session entry:</strong> coin-up and credit display, Start, the ACCESS sequence, and the offline PLAYER01 participant/card-entry screens. This does not establish online services or working physical card readers.</li>
  <li><strong>Mode selection:</strong> the mode-select screen and its transition into music selection. The resource-selection correction is in source, but a fresh post-fix visual capture is still outstanding.</li>
  <li><strong>Game options:</strong> opening and changing the option menu, including applying RANDOM. The retained screenshots still show rendering defects.</li>
  <li><strong>Music selection:</strong> browsing the real song catalogue, version and difficulty categories, song details, selection countdown, and song confirmation, followed by the fade toward gameplay.</li>
  <li><strong>Audio and input controls:</strong> audio is fully working for the implemented screens and flows, as are the input controls used to navigate them, change options, and select and confirm songs. This does not extend the working scope into playable stages.</li>
</ul>

<p><strong>IIDX’s boundary at this point is before gameplay:</strong> no playable stage, player-session results, or complete game session is established. DDR is further along, but its demonstrated Beginner session is still a bounded working path, not a claim that the entire game is finished. The visual defects shown earlier remain part of this snapshot.</p>

<h2 id="time-llms-and-money">Time, LLMs, and money</h2>

<p>I did not track human hours. I could reconstruct some of it from session timestamps, but that measures session length, not my actual attention and any cognitive energy I spent.</p>

<p>The shape of the human work changed, though. In the first weeks I watched runs, read diffs, stopped and steered the agent often. The early sessions needed a lot of babysitting because the environment, the evidence boundaries, and the definition of a good stopping point were still being discovered. Later I could leave a bounded job running and review the outcome. That shift came from better contracts and better evidence, not from a single model upgrade.</p>

<p>The session database records the machine side more precisely. These are summed request durations, not wall-clock time; parallel sessions overlap, so the hours add up to more than the elapsed calendar period.</p>

<table>
  <thead>
    <tr>
      <th> </th>
      <th style="text-align: right">DDR EXTREME</th>
      <th style="text-align: right">IIDX 9th style</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Requests</td>
      <td style="text-align: right">249,152</td>
      <td style="text-align: right">119,264</td>
    </tr>
    <tr>
      <td>Sessions (subagents)</td>
      <td style="text-align: right">5,036 (3,770)</td>
      <td style="text-align: right">1,466 (1,378)</td>
    </tr>
    <tr>
      <td>Prompt tokens</td>
      <td style="text-align: right">9.36 B</td>
      <td style="text-align: right">5.15 B</td>
    </tr>
    <tr>
      <td>Cache-read tokens</td>
      <td style="text-align: right">17.62 B</td>
      <td style="text-align: right">8.76 B</td>
    </tr>
    <tr>
      <td>Output tokens</td>
      <td style="text-align: right">62.1 M</td>
      <td style="text-align: right">33.6 M</td>
    </tr>
    <tr>
      <td>Reasoning tokens</td>
      <td style="text-align: right">43.0 M</td>
      <td style="text-align: right">23.3 M</td>
    </tr>
    <tr>
      <td>Cache share</td>
      <td style="text-align: right">65.3%</td>
      <td style="text-align: right">63.0%</td>
    </tr>
    <tr>
      <td>Summed model time</td>
      <td style="text-align: right">2,186.9 h</td>
      <td style="text-align: right">1,276.3 h</td>
    </tr>
  </tbody>
</table>

<p>Combined, that is 368,416 requests and 3,463.2 hours of summed model time across both projects, from late July to mid-October 2026.</p>

<p>The following lists the various models I used with a pre-configured agent roster assigning different models so different tasks. Though, the majority of the work was done by sol.</p>

<table>
  <thead>
    <tr>
      <th>Model</th>
      <th style="text-align: right">Requests</th>
      <th style="text-align: right">Summed model time</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>gpt-5.6-sol</td>
      <td style="text-align: right">128,907</td>
      <td style="text-align: right">1,916.9 h</td>
    </tr>
    <tr>
      <td>gpt-6-sol</td>
      <td style="text-align: right">187,081</td>
      <td style="text-align: right">1,260.4 h</td>
    </tr>
    <tr>
      <td>gpt-5.6-terra</td>
      <td style="text-align: right">36,321</td>
      <td style="text-align: right">229.1 h</td>
    </tr>
    <tr>
      <td>gpt-5.6-luna</td>
      <td style="text-align: right">3,892</td>
      <td style="text-align: right">24.2 h</td>
    </tr>
    <tr>
      <td>gpt-6-luna</td>
      <td style="text-align: right">6,412</td>
      <td style="text-align: right">15.7 h</td>
    </tr>
    <tr>
      <td>deepseek-v4-flash</td>
      <td style="text-align: right">5,687</td>
      <td style="text-align: right">16.3 h</td>
    </tr>
    <tr>
      <td>gpt-5.4-mini</td>
      <td style="text-align: right">116</td>
      <td style="text-align: right">0.6 h</td>
    </tr>
  </tbody>
</table>

<p>The most interesting observation is not a ranking. <code class="language-plaintext highlighter-rouge">gpt-6-sol</code> handled 45% more requests than <code class="language-plaintext highlighter-rouge">gpt-5.6-sol</code> in about two-thirds of the summed model time: 187,081 requests and 1,260.4 hours, against 128,907 requests and 1,916.9 hours. Average request duration fell from 53.7 seconds to 24.2 seconds. Prompt tokens per request were roughly comparable, around 117k versus 110k, while the cache share fell from 79.1% to 48.2%.</p>

<p>I would not call that a controlled benchmark. The workflow, prompt structure, and task mix changed between those periods, and a shorter request can mean a smaller task rather than a better model. It is a reason to keep measuring, not a conclusion about which model is “best”.</p>

<p>On money: I run two OpenAI Pro subscriptions at €229 per month each, so €458 per month. The period spans roughly three billing cycles, which is about €1,374. If I allocate that by summed model time, DDR accounts for about €867 and IIDX about €507. That is an allocation, not metered spend. The recorded cost fields in the session database are zero because this is subscription usage, not API billing.</p>

<p>I also started experimenting with DeepSeek V4 Flash near the end of this period: 5,687 requests and 16.3 hours of recorded model time. It is too early to judge. The OpenAI plans had several usage resets, banked resets, and a token credit when the plan changes, which makes a simple “cost per game” comparison even more difficult at this time.</p>

<h2 id="whats-next">What’s next</h2>

<p>Work on both projects is continuing. My immediate goal is to complete the source lifting for DDR EXTREME and beatmania IIDX 9th style, building on the working paths shown here until the remaining screens, game modes, and features are reconstructed.</p>

<p>I also want to source-lift other versions of both games. That makes model time and cost more than a retrospective curiosity: I want to understand what makes this work more efficient and how much of the tooling and knowledge carries over to the next game.</p>

<p>The longer-term vision is to use that reconstructed source as the foundation for remasters of these games and eventually release them. There is still plenty of work between the development builds shown here and something ready to share, but that is the direction I want to take.</p>

<p><strong>This is a personal project, done entirely in my spare time and funded out of my own pocket. I am not announcing a release date, feature checklist, or support commitment. There is no public build yet, and I am not recruiting testers at this point in time.</strong></p>

<p>I’ll keep working on it at my own pace and share further updates as it progresses.</p>

<h2 id="earlier-posts">Earlier posts</h2>

<ul>
  <li><a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-1.html">Part 1: From compiled binary to re-created source code</a></li>
  <li><a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-2.html">Part 2: Reconstruction, fidelity, and an AI-assisted workflow</a></li>
</ul>]]></content><author><name></name></author><category term="arcade" /><category term="beatmaniaiidx" /><category term="hardware" /><category term="llm" /><category term="dancedancerevolution" /><category term="reverse-engineering" /><summary type="html"><![CDATA[This is the third post in the series. The first post is the high-level introduction; the second post is the technical deep dive into the workflow. This one is a progress report: what the two ports do today, what broke on the way, which problems I caught and which the tooling caught, and what the work has cost so far.]]></summary></entry><entry><title type="html">LLM assisted source lifting and game porting (1): From compiled binary to re-created source code, a foundation for game modernization and preservation</title><link href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-1.html" rel="alternate" type="text/html" title="LLM assisted source lifting and game porting (1): From compiled binary to re-created source code, a foundation for game modernization and preservation" /><published>2026-10-18T14:00:00+00:00</published><updated>2026-10-18T14:00:00+00:00</updated><id>/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-1</id><content type="html" xml:base="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-1.html"><![CDATA[<p>This post is me sharing my knowledge and learnings so far on leveraging LLMs
in reverse engineering (arcade) video games. The goal is re-creating their
source code from their original binaries and making them work on the target
x86 Linux/Windows platform. This combination of “source lifting” and
game porting work establishes the foundation for improving upon the original games
with bugfixes, modding support or remasters, making these games playable on
modern and different hardware.</p>

<p>A more technical deep dive on how specifically LLMs were utilized in this project
is provided by a <a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-2.html">separate technical writeup</a>. This post focuses primarily on the
higher level aspects of the project itself and the LLM usage in it.</p>

<h2 id="a-word-on-llm-assisted-writing">A word on “LLM-assisted writing”</h2>

<p>This post was written with the support of an LLM. However, this here, is actually me, the human writing this section to be transparent about it. I did review
this post prior publishing and also tweaked several things by hand.</p>

<p>My goal is to share the ideas, principles and concepts that I applied in these projects. I believe this knowledge can benefit similar use-cases, and in general help others in figuring out how to make hopefully better use of LLMs in doing great and meaningful things.</p>

<p>LLMs didn’t make writing this post possible, but rather lowered the bar for me to spend that extra time and effort in getting this out. I hope the result, no matter how and who/what wrote it, is what counts and achieves on the knowledge sharing aspect. Because in the end, that’s what I believe does actually matter.</p>

<h2 id="motivation">Motivation</h2>

<p>I’ve been around the arcade games scene for ~20 years. Over time,
reverse engineering, and an interest in the hardware that keeps old games
running came along, and kept driving my personal and professional development until this day. I’ve wanted
the source to some of those games for a
long time. A small binary patch is one thing; changing a game in a substantial
way, or bringing it to another platform, is quite another. Reconstructing an
entire game by hand means repeating a huge amount of tedious work before you can
even get to the change you wanted to make.</p>

<p>For me, the interesting possibilities include proper ports to other hardware platforms, widescreen/HD support,
modding, fixes, and upgrades to games. Personally, I’d always wanted to play DDR 4thMIX PLUS at 60 frames per second instead of
30.</p>

<p>I’ve been experimenting with LLM-assisted source lifting on the following two games:</p>
<ul>
  <li><a href="https://remywiki.com/AC_DDR_EXTREME">Dance Dance Revolution EXTREME</a> that runs on the <a href="https://codeberg.org/shiz/arcade-docs/src/commit/994664efe21c1a167b4b51d30c0df3e644dfdfd6/konami/boards.md#system-573">System 573 Digital arcade platform</a></li>
  <li><a href="https://remywiki.com/AC_9th_style">beatmania IIDX 9th style</a> that runs on <a href="https://codeberg.org/shiz/arcade-docs/src/commit/994664efe21c1a167b4b51d30c0df3e644dfdfd6/konami/boards.md#knm-845g3-a02">PC-based arcade hardware</a></li>
</ul>

<p>By <strong>source lifting</strong> I
mean working from the original executable toward compilable source for the
original program, rather than writing a new game that merely looks similar.
The larger job that involves a significant portion of human driven design and cognition is game porting; reconstructing the missing source by utilizing LLMs closes the
gap that would otherwise stop me from doing it.</p>

<h2 id="what-am-i-actually-trying-to-preserve">What am I actually trying to preserve?</h2>

<p>When I show people progress, the questions are usually not about the agent
workflow. They’re about what actually runs. Is this original machine code in
an emulator? A new recreation? Does the reconstructed source compile back to
the original binary? How do I know the LLM hasn’t replaced something subtle
with a plausible shortcut?</p>

<p>Those are fair questions that establish important distinctions. My target is compiled reconstructed game logic,
with the platform dependencies adapted to the new runtime. An emulator can
serve as the reference without being the thing that executes the port’s game
logic. I call this <strong>source lifting</strong> and <strong>game porting</strong>, rather than using
“decompilation” as shorthand for every possible approach.</p>

<p>I’m not requiring a byte-matching original binary before porting. Matching
would offer stronger evidence about the generated machine code, and my checks
are not a substitute for that guarantee. What I want is faithful game behavior:
graphics, audio, input response, and gameplay that behave as expected. That
still includes subtle timing and old quirks that players rely on. “It looks
right in a screenshot” is nowhere near enough, and not the reason to stop and call this done.</p>

<p>The first major milestone I’m working toward is <strong>functional convergence</strong>:
getting the game working end-to-end with as much agent autonomy as practical,
while correcting the fidelity differences discovered. This happens either by the agent itself through the use of purpose built tooling or through some additional support by human driven QA feedback when the agentic tooling hits limitations. I think of this as
“90/10 convergence”—a working state, not a measured percentage of reconstructed
code, verified behavior, or bugs eliminated. It is a milestone, not the end of
source lifting.</p>

<p>Eventually I’d like a DDR remaster that brings the System 573 games to Linux/Windows. For IIDX, I want a
consistent CLI across versions, with cabinet options and native BIO2 support to make running the old versions on newer cabinets easier.
Those are ambitions, not features I’m claiming to have finished. Deliberate
upgrades need to remain separate from the baseline reconstruction.</p>

<h2 id="give-the-agent-something-that-can-prove-it-wrong">Give the agent something that can prove it wrong</h2>

<p>The most useful tool I built is something I would call a <strong>game-loop debugger</strong>. It isn’t a CPU-level debugger (like GDB):
it lets the agent step frames, advance the game, dump video and audio buffers,
and inject gameplay inputs. Those operations can also be scripted to create something reflecting repeatable intergration tests.</p>

<p>For the original games/references of DDR and IIDX, the setup looks like follows:</p>
<ul>
  <li>DDR: Use <a href="https://github.com/mamedev/mame">MAME</a> as the runtime reference, add the game-loop debugger controls using <a href="https://docs.mamedev.org/luascript/index.html">Lua scripting interface</a></li>
  <li>IIDX: Use the original software and run it with a modified version of <a href="https://github.com/djhackersdev/bemanitools">bemanitools</a> that implements the game-loop debugger controls</li>
</ul>

<p>The same game-loop debugger controls were built into a runtime that the source lifted DDR code runs on. For IIDX, since the source lifted version is rebuilt on the same runtime basis (just a Win32 application) as the original, we can use the same modified bemanitools tooling.</p>

<p>That gives the agent a way to reproduce a sequence and compare results,
rather than just tell me its code seems reasonable. Randomness can still
make runs diverge, and an emulator is not an infallible substitute for the
cabinet. Matching it tells me about the behavior tested under that setup,
not every behavior on the original hardware.</p>

<p>I split the evidence into <strong>fidelity tiers</strong>:</p>
<ul>
  <li>A0: covers static analysis and tests grounded in the original decompiled and disassembled code</li>
  <li>A1: compares controlled runs with a purpose-built game-loop debugger in the development environment</li>
  <li>A2 is the planned comparison against original hardware</li>
</ul>

<p>Some targetted ordinary code review happens outside those tiers. The ledger records which evidence
exists—it doesn’t make an unchecked function correct.</p>

<p>Consider an agent hardcoding a timing window that should be read from data.
That could survive both a screenshot and ordinary gameplay on one chart.
Following the original data access, then testing inputs that distinguish the
two implementations, is much more useful than asking the agent whether it
thinks the game is accurate. This is an example of the kind of mistake the
checks need to expose, not a claim about a specific chart format.</p>

<p>The runtime feedback has caught most of the defects I’ve encountered so far,
but I don’t have a measured detection percentage. I still intend to playtest
on the cabinet and explore a blind A/B test against my original System 573/Bemani PC
hardware. That work isn’t done yet. An experienced player can notice things
the automated comparisons don’t observe, and manual reverse engineering can
miss those same quirks too.</p>

<p>The question I keep coming back to is: is more complexity necessary, or can I
get the required result another way? That’s an argument for choosing checks
carefully, not for dismissing differences. It also changed how I approach setting up the development and testing
environment and the agents themselves.</p>

<h2 id="start-with-a-place-for-the-code-to-live">Start with a place for the code to live</h2>

<p>Early on I was too willing to start lifting and solve the development and testing environment later.
That makes every call into hardware or a library an invitation for the agent to “improvise”.
On a PC target, it’s easy to get sidetracked by a USB I/O board or firmware
download that the development setup is meant to substitute. On System 573,
PlayStation facilities are only part of the story: there’s additional arcade
hardware and the ways the game accesses it matter just as much.</p>

<p>Next time, I want to define the target compiler, libraries, runtime, reference
material, and application-facing hardware boundaries <em>before</em> lifting game
code. I want a tiny program to compile and run through the intended entry
point first. That is the <strong>source-lifting sandbox</strong>: the known environment
within which the lifted code should work. It isn’t a demand to implement all
the hardware up front. A rough marker for a platform boundary is useful;
building an FPGA emulator for DDR before the game has even reached its first screen is
not.</p>

<p>I would also write two short documents at the start. One describes the game:
its screens, controls, rules, and things that have to stay in sync, like DDR’s
music, arrows, and player input. The other describes the target platform:
its software facilities and the specific hardware interfaces the application
can see. Emulator and substitute-runtime source can help establish those
interfaces, but the game doesn’t need a copy of the emulator’s internals.</p>

<h2 id="follow-the-path-the-player-can-see">Follow the path the player can see</h2>

<p>The first useful slice to lift is usually from the original entry point to the first
visible warning or startup screen. It proves that there is a connected running
program, not just a pile of compiling functions. After that, an operator/test menu
is a good candidate: it exercises text, graphics, input, and many device
interfaces without requiring a complete gameplay system which helps a lot in establishing all the hardware platform interfaces and abstraction before piling a lot of game flow/engine stuff on top of it.</p>

<p>The trick is to specify what that slice does <em>not</em> require. “No sound” is
ambiguous: it might mean no playback yet, but the sound menu and its calls
still have to be dealt with. “Pass the hardware checks for now” should mean
connecting the game’s real call path to an explicitly temporary platform
stub. It does not mean pretending that the device has been faithfully
recreated. From there I’d take the normal game path in smaller steps: attract
loop, start and mode selection, song selection, gameplay, then results and
game over.</p>

<p>This changed the way I brief agents. “Implement the operator menu” leaves too
much room for them to solve the wrong problem. “Lift the path along the <strong>tracer-bullet</strong> (see Hunt &amp; Thomas’ “The Pragmatic Programmer”) that renders and
navigates the operator menu; connect its device calls through platform seams;
return provisional success for these checks; don’t implement playback or
emulate the devices” gives both a finish line and a boundary</p>

<h2 id="a-working-game-is-a-milestone-not-the-finish-line">A working game is a milestone, not the finish line</h2>

<p>The agent should do as much as it can with the game-loop debug tooling: connect the
functional paths, exercise them, and fix the functional defects and differences
from the original that it detects. I playtest more broadly and feed concrete
problems back for investigation and correction to speed things up, or “help” the agent what they can’t detect because of tooling limitations.</p>

<p>That is the “90/10” division
of effort I have in mind, not a requirement to find every last bug before a
functional milestone can be useful. Nor is it permission to call a known
fidelity gap solved.</p>

<p>Reaching that state would still leave a larger reconstruction job. Ultimately,
I want <strong>all of the code lifted</strong>, including code ordinary gameplay never
reaches. A successful session cannot show that every error path, alternate
mode, or cold function has been reconstructed. Finishing a selected path is
evidence toward convergence, not proof that the whole game has reached it.</p>

<p>Closing that remaining gap should involve more than Human QA. Possibilities
include checking actual code completeness, revisiting TODOs and unverified
accuracy claims, and assembling a repeatable set of scripted runtime scenarios.
I have not established which combination is effective enough, or what evidence
should justify calling source lifting “100% done” before moving into the next
major phase. That is the next major milestone to define, not a solved final
step in this workflow. The technical write-up discusses those open directions
<a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-2.html#after-functional-convergence-closing-the-remaining-gaps">in more detail</a>.</p>

<h2 id="watch-the-work-around-the-work">Watch the “work around the work”</h2>

<p>Another lesson took longer to notice. I let agents build elaborate ways to
record progress: status files, confidence levels, notes, and more rules for
updating all of them. Some of that was useful, but a lot of a long session could
turn into maintaining the machinery instead of lifting code or checking a
running game. It looked busy until I asked what actually changed between the
start and end of a bounded stretch of work.</p>

<p>Auditing those stretches helped. I looked for time spent on lifting, runtime
checks, documentation, and <strong>agentic machinery</strong>, then inspected what the
machinery was buying me. Often the question I really needed answered was much
smaller: has this function been lifted, and has it been exercised in the
connected runtime? I don’t want to mistake a tidy progress report for a
working game again. The <a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-2.html#after-functional-convergence-closing-the-remaining-gaps">detailed write-up</a> explains how I would inspect a
session without claiming that one impression or one measurement applies to
every run.</p>

<p>My setup made it possible to leave an agent working while I was away: OpenCode
through OpenChamber on a remote machine, with phone access when something
actually needed a decision. <a href="https://github.com/yvgude/lean-ctx">Lean-CTX</a> helped with caching and context, and <a href="https://github.com/batteryshark/rekit">REkit</a>
with binary analysis.</p>

<p>I also ran into cross-project context drift when I used
shared Lean-CTX knowledge across many projects; I disabled that part of my
setup. That’s an account of my configuration, not a blanket verdict on the
tool. Likewise, a goal that keeps a session running helps only when the work
has a clear stopping condition and the agent knows which decisions belong to
me (i.e. the OpenChamber Goal feature).</p>

<h2 id="the-reproducible-part">The reproducible part</h2>

<p>I put the engineering approach in a separate <a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-2.html">technical write-up</a>:
how I distinguish source lifting from other approaches, what the fidelity
tiers establish, how the game-loop debugger supplies feedback, and how to
set up the sandbox and scope connected slices. It should be useful even if
you’re lifting a different game and application type with different tools. I want to share enough
for someone else to take the ideas, give them to an agent, and adapt them to
their own platform—not pretend that my exact workflow files would work
unchanged everywhere.</p>

<p>There’s still a lot to try: smaller handoffs between contexts, different
models, perhaps local models, and possibly parallel slices once the first
running path is solid. I haven’t established that those changes improve this
workflow yet. For now I’d rather let one connected game path take another day
than make concurrency another problem to debug.</p>

<p>If you’ve attempted something similar, I’d be interested in what worked, what
failed, and especially how you kept hardware boundaries and fidelity claims
honest. I believe that we all benefit from sharing each others methods and results to improve on reconstructing source code for more old games in order to preserve them.</p>

<h2 id="acknowledgements">Acknowledgements</h2>

<p>Thanks to the following folks who have been around and clanking along with me so far:</p>

<ul>
  <li><strong>Batteryshark</strong> for getting me into game source lifting with LLMs and showing me the potential this got</li>
  <li><strong>GravitySandwich</strong> for bouncing ideas around, troubleshooting, and helping improve the source lifting approach</li>
  <li><strong>水 -sui-</strong> for knowledge exchange and sharing their progress and learnings on their own LLM-assisted game re-creation project</li>
</ul>

<hr />

<p>Next in the series: <a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-2.html">Part 2: Reconstruction, fidelity, and an LLM-assisted workflow</a>.</p>]]></content><author><name></name></author><category term="arcade" /><category term="beatmaniaiidx" /><category term="hardware" /><category term="llm" /><category term="dancedancerevolution" /><category term="reverse-engineering" /><summary type="html"><![CDATA[This post is me sharing my knowledge and learnings so far on leveraging LLMs in reverse engineering (arcade) video games. The goal is re-creating their source code from their original binaries and making them work on the target x86 Linux/Windows platform. This combination of “source lifting” and game porting work establishes the foundation for improving upon the original games with bugfixes, modding support or remasters, making these games playable on modern and different hardware.]]></summary></entry><entry><title type="html">LLM assisted source lifting and game porting (2): Reconstruction, fidelity, and an LLM-assisted workflow</title><link href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-2.html" rel="alternate" type="text/html" title="LLM assisted source lifting and game porting (2): Reconstruction, fidelity, and an LLM-assisted workflow" /><published>2026-10-18T14:00:00+00:00</published><updated>2026-10-18T14:00:00+00:00</updated><id>/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-2</id><content type="html" xml:base="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-2.html"><![CDATA[<p>This post is the second one in a series of me sharing my knowledge and learnings so far on leveraging LLMs in reverse engineering (arcade) video games. This is a significantly longer and more technical deep dive into how things were done and why.</p>

<p>The <a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/18/llm-assisted-source-lifting-and-game-porting-1.html">first post</a> is shorter and stays on a fairly high level. Depending on what you are interested, you
might want to read the shorter one first.</p>

<h2 id="a-word-on-llm-assisted-writing">A word on “LLM-assisted writing”</h2>

<p>This post was written with the support of an LLM. However, this here, is actually me, the human writing this section to be transparent about it. I did review
this post prior publishing and also tweaked several things by hand.</p>

<p>My goal is to share the ideas, principles and concepts that I applied in these projects. I believe this knowledge can benefit similar use-cases, and in general help others in figuring out how to make hopefully better use of LLMs in doing great and meaningful things.</p>

<p>LLMs didn’t make writing this post possible, but rather lowered the bar for me to spend that extra time and effort in getting this out. I hope the result, no matter how and who/what wrote it, is what counts and achieves on the knowledge sharing aspect. Because in the end, that’s what I believe does actually matter.</p>

<h2 id="motivation">Motivation</h2>

<p>I want to port these games, but I don’t have their source code. The missing
step is to reconstruct it from the original executable. I call that step
<strong>source lifting</strong>, and the larger project <strong>source lifting and game porting</strong>.
The goal is compiled, modifiable game code derived from the original program,
with its platform dependencies adapted to a defined runtime—not a new game
designed to resemble it, or an executable that simply bundles the original
machine code with an emulator.</p>

<p>The specific games serving as the use-cases are:</p>
<ul>
  <li><a href="https://remywiki.com/AC_DDR_EXTREME">Dance Dance Revolution EXTREME</a> that runs on the <a href="https://codeberg.org/shiz/arcade-docs/src/commit/994664efe21c1a167b4b51d30c0df3e644dfdfd6/konami/boards.md#system-573">System 573 Digital arcade platform</a></li>
  <li><a href="https://remywiki.com/AC_9th_style">beatmania IIDX 9th style</a> that runs on <a href="https://codeberg.org/shiz/arcade-docs/src/commit/994664efe21c1a167b4b51d30c0df3e644dfdfd6/konami/boards.md#knm-845g3-a02">PC-based arcade hardware</a></li>
</ul>

<p>In short, the rough high-level steps of the approach I applied:</p>

<ul>
  <li>Analyze the binary</li>
  <li>Extract a searchable decompilation corpus</li>
  <li>Reconstruct compilable source</li>
  <li>Connect paths through the application</li>
  <li>Compare the result against the original
    <ul>
      <li>Static checks and controlled runtime comparisons give the agent feedback</li>
      <li>Hands-on testing remains part of the plan.</li>
    </ul>
  </li>
</ul>

<p>My acceptance target is faithful game behavior, not a requirement to reproduce
the original binary byte for byte. That is a deliberate tradeoff, not an
equivalent form of proof. This post explains the checks I use, what they
can miss, and how the development environment and agent workflow support them.
It does not claim that either game is complete or that hardware comparison has
already been established.</p>

<h2 id="terms-used-in-this-article">Terms used in this article</h2>

<p>I realized that creating this article forced me to think about terminology a lot.
It helped me with coming up with, I hope, good explanations for the differences
that I see and understand regarding the different approaches to this type
of problem. These terms overlap in community usage. The definitions here describe the
distinctions relevant to this work, not a universal classification:</p>

<ul>
  <li><strong>Behavioral reimplementation or fan recreation:</strong> a new implementation
built from an understanding of the game’s behavior, potentially informed by
reverse engineering, with freedom to choose a different architecture. The
important distinction is the implementation’s relationship to the original
code, not whether someone calls the result a fan project.</li>
  <li><strong>Matching decompilation:</strong> source reconstruction whose build targets the
original machine code within a stated matching scope. A function match and
a complete executable match are different claims.</li>
  <li><strong>Static recompilation or binary translation:</strong> translation of machine code
into another executable representation, potentially for another processor.
This does not necessarily reconstruct a maintainable source-level expression
of the original game’s logic. The word “recompilation” alone is ambiguous:
it can also just mean compiling reconstructed source again.</li>
  <li><strong>Emulator-based execution:</strong> execution of original machine code against an
emulated platform. Packaging an emulator and game data as an executable is
not, by itself, reconstruction of the application source.</li>
  <li><strong>Source lifting:</strong> reconstruction of compilable application source from
binary evidence, retaining a traceable relationship to the original logic.</li>
  <li><strong>Game porting:</strong> adaptation of that application and its platform facilities
to another supported environment.</li>
</ul>

<p>These are not mutually exclusive. A source lift can target matching output;
reconstructed software can run under an emulator. Using an emulator as the
<em>reference</em> for a port is also different from using it to execute the port’s
game logic. Here the intended game logic executes as compiled reconstructed
source, while platform adapters supply the selected target facilities and
original game data remains input. The exact boundary and remaining substitutes
must be stated for each implemented slice.</p>

<p>Existing SDKs and game-specific abstraction layers can help locate those
boundaries. Their presence does not guarantee that every device access is
abstracted, or remove the need to inspect memory-mapped hardware calls.</p>

<h2 id="what-accuracy-means-for-these-ports">What accuracy means for these ports</h2>

<p>The target is <strong>high behavioral fidelity</strong>: the game must play as expected, with
the graphics, sound, input response, and timing that make it the same game to
its players. This is not a requirement for universal instruction-level or
cycle-level equivalence. Exact internal behavior still matters wherever it
affects those outcomes: arithmetic, game asset/data interpretation, or a one-frame
timing difference can be central rather than incidental.</p>

<p>“The player cannot tell the difference” expresses the intended experience,
not a proof or a license to ignore subtle defects. It needs specific tests
and experienced playtesting. Quirks that look like bugs may be part of the
expected game; silently correcting them would change the reconstruction.</p>

<h3 id="functional-convergence-versus-source-lifting-completion">Functional convergence versus source-lifting completion</h3>

<p>My first major milestone is <strong>functional convergence</strong>: a connected game that
works end-to-end, with as much agent autonomy as practical. The agent exercises
the available runtime controls and fixes detected functional defects and
original-fidelity differences; I contribute broader playtesting and feed issues
back for diagnosis and correction. I call this “90/10 convergence” as a working
description of that division of effort, not measured code coverage, fidelity,
or a quota of defects we can leave behind. It does not require exhaustive bug
discovery, and it does not make a known unresolved fidelity claim pass.</p>

<p>Three questions remain distinct:</p>

<ul>
  <li><strong>Functional convergence:</strong> do the intended connected application flows work?</li>
  <li><strong>Code completeness:</strong> has all original code in the identified executable and
code-bearing library scope actually been reconstructed, including cold paths
and code normal runtime scenarios never reach?</li>
  <li><strong>Behavioral fidelity:</strong> does that reconstruction preserve the original
behavior, supported by evidence with explicit limits?</li>
</ul>

<p>None answers the other two by itself. The ultimate technical goal is all code
lifted, without dropping code just because a playthrough does not reach it.
Functional convergence is a major state on that journey, not a claim that
either game is complete. How to close the remaining gap effectively—and what
evidence should justify declaring the source lift finished—is still open.</p>

<p>Longer term, I want this foundation to support a DDR remaster covering the
System 573 games in one Linux/Windows application using the user’s CHD data.
For IIDX, the aim is a consistent CLI across versions, with options for cabinet
types and native BIO2 support, rather than necessarily one binary. Those are
future directions, not delivered capabilities claimed here. First establish
the reconstructed baseline; record deliberate remaster changes separately so
they do not hide porting mistakes.</p>

<h3 id="why-not-require-a-matching-binary-first">Why not require a matching binary first?</h3>

<p>A matching target provides a strong objective check on the resulting machine
code. It is a valid choice, and it can catch differences that selected runtime
tests miss. My selected target is a faithful, modifiable port without requiring
that matching step first. That allows work to concentrate on a connected
target-runtime application and the behavior I want to preserve, but gives up
the broad machine-code correspondence that a verified match could establish.</p>

<p>Cross-compiling a reconstructed function to MIPS does not by itself make its
bytes match the original. Compiler version, code-generation and optimization
settings, ABI, and address-dependent linking details may all affect comparison.
A mismatch need not mean a behavioral difference; a match for one function
does not prove correct callers, data, or platform integration. Matching output
also does not uniquely recover the original source text.</p>

<p>Similarly, a decompiler emitting C-like code does not establish that the
original game was written in C. The reconstruction language and the historical
source language are separate facts. This method does not depend on assuming
we have identified the latter.</p>

<p>The guiding question is: <strong>is the additional complexity necessary, or is there
another way to achieve the required result?</strong> I apply that to matching work,
hardware test automation, and agent tooling alike. It does not remove the
obligation to investigate a concrete behavioral difference. It means choosing
checks proportionate to the fidelity claim rather than treating every possible
internal difference as an equally important porting defect.</p>

<h2 id="what-backs-up-the-reconstructed-source">What backs up the reconstructed source?</h2>

<p>There are two related questions: did the source preserve the original logic,
and does the connected application behave like the original under the tested
conditions? Neither source inspection nor a successful runtime comparison
answers both completely. The fidelity ledger records the evidence and gaps;
recording a claim does not make it true.</p>

<p>For a function or connected path, the useful record is small: the binary/code
scope, the A0 fidelity checks and A1 fidelity scenarios actually run, where their results can be
inspected, and any remaining stubs or unknowns. Untested, blocked, and passing
are different states. A fidelity tier label should never stand alone as a claim about
the whole game, and this does not require a new database or elaborate tracking
framework.</p>

<p>Ordinary implementation review comes first, outside the fidelity tiers. Check for
invented APIs, omitted branches, unsupported shortcuts, and disconnected code.
An agent reviewing its own work can help, but is not independent evidence of
correctness.</p>

<h3 id="fidelity-tier-a0-static-fidelity-identity-grounded-reconstruction">Fidelity tier A0: static fidelity, identity-grounded reconstruction</h3>

<p>A0 combines identity-checked reconstruction, independent review, maintained
checks, native execution, and explicit runtime/platform limitations. Its tests
and inspection encode invariants and constraints derived from
analysis of the original program: data dependencies, branch behavior, types,
integration assumptions, and details that need checking in disassembly because
they are unclear or absent in the decompiled pseudo-C. A test should have a
grounded reason for its expected result, not merely confirm the implementation
the agent just wrote.</p>

<p>A0 can still encode a mistaken interpretation. When decompiled expressions,
signedness, memory accesses, or control flow are doubtful, inspect the original
instructions. Passing unit tests are not a claim that all original semantics
have been recovered.</p>

<h3 id="fidelity-tier-a1-runtime-fidelity-in-the-development-environment">Fidelity tier A1: runtime fidelity in the development environment</h3>

<p>A1 compares the reconstructed build against an original-game reference. Both
expose game-loop debugging controls so the agent can inject inputs, advance
execution, and compare frame and audio buffers. The evidence belongs to the
scenario, builds, inputs, and reference environment actually exercised—not to
every untested function merely linked into that build.</p>

<p>A screenshot checks selected visual output. A scripted input sequence checks
more transitions. Audio comparisons add another observable interface. None
automatically covers unseen branches, internal state, or every timing boundary.
A1 is useful precisely because it supplies concrete feedback, not because it
makes that feedback complete.</p>

<h3 id="fidelity-tier-a2-human-qa-and-real-hardware-playtesting">Fidelity tier A2: Human QA and real hardware playtesting</h3>

<p>Short and focused human-driven QA sessions in a development environment allow for uncovering bugs and defects the agent missed for likely tooling limitation reasons.
After that, a human playtest in a “production environment”, i.e. on the target production hardware/cabinet, must confirm that
gameplay behavior, performance and timing accuracy are holding up to the actual player’s expectations.</p>

<p>Experienced-player QA and a controlled hardware comparison are related
but not interchangeable. A blind A/B test that uses the same cabinet/player interface visible to the players, but swaps out the original hardware and software with the newer hardware and the reconstructed game without the player seeing that, might be a final test to establish human-indistinguishability.</p>

<h3 id="example-a-timing-window-that-looks-right-but-is-wrong">Example: a timing window that looks right but is wrong</h3>

<p>Suppose an agent hardcodes a judgment window where the original reads the
value from chart data. This is an illustrative failure mode, not a claim about
a particular game’s chart format. Ordinary gameplay may look identical if the
chosen data happens to contain the same value as the constant.</p>

<p>The investigation would work in two directions:</p>

<ol>
  <li>Follow the original data read and its use in the judgment calculation.
Check the disassembly where necessary and retain that dependency in the
reconstruction. Encode grounded constraints in A0 tests.</li>
  <li>Find supported data and input timings that distinguish the implementations:
for example, different observed window values and inputs just inside, at,
and outside the relevant boundaries. Compare judgments in the controlled
original and reconstructed runs where the harness exposes them.</li>
</ol>

<p>If we cannot observe or exercise those distinctions yet, mark that part
unverified. A matching screenshot is not an answer. An extended playthrough is
useful integration coverage, but may also miss the distinction. Manual
reconstruction can make the same mistake; AI makes a repeatable feedback loop
especially valuable, not the problem unique.</p>

<h2 id="the-game-loop-debugger">The game-loop debugger</h2>

<p>The central runtime tool is a <strong>game-loop debugger</strong>: an application-level
interface for controlling execution and inspecting user-facing output, rather
than an instruction-level CPU debugger. Its controls include frame stepping,
advancing execution, frame-buffer recording or dumping, audio-buffer dumping,
and gameplay input injection. They can be scripted to create something reflecting repeatable intergration tests.</p>

<p>The reconstructed runtime exposes these controls. On the DDR reference side,
<a href="https://github.com/mamedev/mame">MAME</a> runs the original game and <a href="https://docs.mamedev.org/luascript/index.html">Lua</a> scripting supplies corresponding controls
through the same CLI interface for the agent. The PC reference setup uses the
original game with <a href="https://github.com/djhackersdev/bemanitools">bemanitools</a> and a hook library to expose runtime control;
it is not simply the same emulator arrangement as DDR.</p>

<p>This makes a replay script a practical test input: drive the game through
menus, select songs, supply gameplay inputs, and collect outputs at selected
points. A full three-song session is the kind of sequence the interface can
express; this is not a claim that such a replay has already passed end-to-end
for both projects. Comparisons need identifiable builds, starting data and
configuration, input schedules, and defined capture points. Nominally stepping
one frame on each side does not itself guarantee aligned simulation time or
audio boundaries.</p>

<p>Randomness limits repeatability as well as unmanaged game-side (background) concurrency. The same input script may diverge because
random state or initialization differs, rather than because the lift is wrong.
Where state cannot be controlled or the relevant outputs aligned reliably,
the comparison must report that limitation instead of treating every mismatch
as a defect—or silently ignoring it. There is no universal deterministic replay
claim here.</p>

<h3 id="how-much-can-the-reference-runtime-tell-us">How much can the reference runtime tell us?</h3>

<p>MAME is a useful reference, not infallible original hardware. Its usefulness
must be qualified for the particular game revision, emulator revision, and
behavior being tested. Agreement in menu navigation does not establish cabinet
audio/input timing, while a device limitation does not invalidate every visual
observation. A shared substitute on both sides can also conceal an error.</p>

<p>For an A1 comparison, identify relevant reference limitations and substitutions.
If original hardware or another independent source has not checked an aspect,
do not imply that it has. The same caution applies to bemanitools: substitution
makes development possible without all the physical devices, but does not
constitute proof of those devices’ behavior.</p>

<p>In my experience, this feedback loop has caught most of the defects I have
encountered so far. That is an observation, not a measured bug-detection rate.
Hands-on QA may be a better next investment than automating every last hardware
comparison. If a concrete remaining timing defect needs a more precise check,
though, the existing harness’s success is not a reason to waive it.</p>

<h2 id="source-code-lifting-life-cycle-from-evidence-to-a-running-path">Source-code lifting life-cycle: From evidence to a running path</h2>

<p>The following covers the life-cycle states the lifted source code is going through in the lifting process. Several things that sound like “progress” are different claims:</p>

<table>
  <thead>
    <tr>
      <th>Source code state</th>
      <th>What it demonstrates</th>
      <th>What it does not demonstrate</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Raw corpus</td>
      <td>A searchable rendering of functions and binary addresses exists.</td>
      <td>That the decompiler is correct or the source compiles.</td>
    </tr>
    <tr>
      <td>Mechanical source</td>
      <td>Reconstructed functions can be compiled for the target.</td>
      <td>That they are reachable from the original program entry point.</td>
    </tr>
    <tr>
      <td>Connected path</td>
      <td>The application reaches an observable result through lifted code.</td>
      <td>That every branch or device behaves like the original.</td>
    </tr>
    <tr>
      <td>Compared behavior</td>
      <td>Selected observations match an original-runtime oracle.</td>
      <td>Fidelity outside the tested inputs, frames, and boundary behavior.</td>
    </tr>
  </tbody>
</table>

<p>Keep those claims separate in code reviews and status reports. A platform stub
can make a connected path run, but it does not turn that device check into a
verified reconstruction.</p>

<h2 id="workflow-map">The source lifting workflow</h2>

<p>The preceding sections document in a very mechanical style the steps of the workflow, the evidence and tools, from an agents perspective. The rest of the
walkthrough of the workflow follows this map: <strong>select a numbered box to jump to its detailed
explanation</strong>, then use the return link beneath that section’s heading to find
your place again. Read the rows left to right, then down; on a phone, follow
the boxes from top to bottom.</p>

<link rel="stylesheet" href="/assets/2026-10-18-llm-assisted-source-lifting-and-game-porting-2/workflow.css" />

<nav class="lifting-map" aria-label="Source-lifting workflow reading map">
  <div class="map-phase">
    <p class="map-phase-title">Establish the foundation</p>
    <ol>
      <li><a class="map-step" id="map-context" href="#workflow-context"><span class="map-number">01 · CONTEXT</span><strong>Describe the game &amp; platform</strong><small>Human/player knowledge, original materials, target boundaries.</small></a></li>
      <li><a class="map-step" id="map-runtime" href="#workflow-runtime"><span class="map-number">02 · SANDBOX</span><strong>Prove the development runtime</strong><small>A tiny real application builds and runs.</small></a></li>
      <li><a class="map-step" id="map-corpus" href="#workflow-corpus"><span class="map-number">03 · EVIDENCE</span><strong>Authenticate, analyze &amp; export</strong><small>Keep raw evidence and source ownership distinct.</small></a></li>
    </ol>
  </div>
  <p class="map-connector" aria-hidden="true">↓</p>
  <div class="map-phase map-loop">
    <p class="map-phase-title">Follow a tracer · repeat for each connected slice</p>
    <ol start="4">
      <li><a class="map-step" id="map-slice" href="#workflow-slice"><span class="map-number">04 · DESTINATION</span><strong>Define a bullet tracer as a bounded slice</strong><small>Entry → visible result → exit, with explicit exclusions.</small></a></li>
      <li><a class="map-step" id="map-lift" href="#workflow-lift"><span class="map-number">05 · RECONSTRUCTION</span><strong>Lift &amp; connect reached code</strong><small>Follow calls, data, ABI and state—not function counts.</small></a></li>
      <li><a class="map-step" id="map-platform" href="#workflow-platform"><span class="map-number">06 · PLATFORM</span><strong>Resolve reached contacts</strong><small>Reuse a supported service, realize a narrow contract, or stop.</small></a></li>
    </ol>
    <p class="map-row-arrow" aria-hidden="true">↓</p>
    <ol start="7">
      <li><a class="map-step" id="map-diagnose" href="#workflow-diagnose"><span class="map-number">07 · FEEDBACK</span><strong>Run, inspect &amp; diagnose</strong><small>Observe the connected path and its exact frontier.</small></a></li>
      <li><a class="map-step" id="map-review" href="#workflow-review"><span class="map-number">08 · BOUNDED CLAIMS</span><strong>Review &amp; compare</strong><small>Independent A0; controlled original/rebuilt A1.</small></a></li>
      <li><a class="map-step" id="map-advance" href="#workflow-advance"><span class="map-number">09 · NEXT INCREMENT</span><strong>Correct, reverify &amp; advance</strong><small>Retain explicit gaps; extend the tracer with the next slice.</small></a></li>
    </ol>
    <p class="map-feedback"><strong>Feedback paths—not a waterfall:</strong> A contradiction sends you back to <a href="#workflow-corpus">original analysis</a>, <a href="#workflow-lift">the reconstruction</a>, or <a href="#workflow-platform">the platform boundary</a>. A supported increment leads to the <a href="#workflow-slice">next slice</a>. Run early while lifting; do not wait for all the boxes to be complete.</p>
  </div>
  <p class="map-caption">Original instructions, data and observable behavior remain the reference throughout. Compiling, reaching a screen, and establishing fidelity are different claims. A0/A1 describe evidence about a bounded result—not whole-game completion.</p>
</nav>

<h2 id="workflow-context" class="workflow-heading">1. Before code: describe the game and the platform</h2>

<p class="workflow-return"><a href="#map-context">↩ Back to map: context</a></p>

<p>Two short, revisable documents give the agent a useful frame. They need not be
encyclopedias or a rigid architecture specification. The goal is to give the agent enough context to “understand” the domain with its specific terminology, the domain boundaries, and the game’s design/architecture.</p>

<p>The <strong>domain description</strong> (or game design) explains what the game is: the player’s controls,
screen flow, rules, important mechanics, and timing constraints. For DDR, the
four directions on the dance panel, the on-screen step targets, music timing,
and input judgments are not incidental details. Even a source lift focused on
startup needs to know that later work must compare the synchronization of
audio, video, and input—not just whether an arrow can be drawn.</p>

<p>The <strong>platform description</strong> specifies the intended source target: processor,
operating or console environment, compiler, language, libraries, binary
interfaces, storage, memory map, and application-visible hardware. On an x86
Windows-to-x86 Windows lift, much may come directly from the original platform,
but the exact supported build and substitute-runtime assumptions still belong
here. On System 573 Digital, describe separately the PlayStation-derived
facilities and the extra arcade components. Record how the application reaches
them—SDK calls, mapped addresses, device registers, or other observed
interfaces—rather than dumping an emulator’s entire device implementation
into a design document.</p>

<p>Reference source for an emulator or hardware substitute can reveal addresses,
call conventions, and expected responses. Label which statements are observed
in the binary, which come from reference implementations, and which remain
hypotheses. If the original application’s calls contradict the proposed
boundary, revise the boundary. Avoid promising that an interface supports more
than the lifted path has shown.</p>

<p>An empty <code class="language-plaintext highlighter-rouge">platform/</code> module or a brief boundary note can act as a <strong>signpost</strong>
before lifting. Do not fill it with speculative device APIs. When a lifted
call site first reaches a mapped register or library facility, preserve the
evidence from that call site and give it a narrow interface. Keep ordinary
game logic on one side and substitute device behavior on the other.</p>

<h2 id="workflow-runtime" class="workflow-heading">2. Prove the development runtime</h2>

<p class="workflow-return"><a href="#map-runtime">↩ Back to map: sandbox</a></p>

<p>Do this <em>before</em> lifting an application-sized body of source. Effectively, it provides the foundation and sets up the agent for success.</p>

<ol>
  <li>Inventory the original executable and code-bearing libraries, game data,
symbols if available, runtime tools, documentation, and available
reference implementations. Keep original inputs identifiable and unchanged.</li>
  <li>Choose the actual compiler and target ABI, language mode, libraries, link
arrangement, and run environment. Record versions and where they came from.
A guessed “close enough” compiler can create problems later at every
platform boundary.</li>
  <li>Compile and run an application-shaped “hello world” through the <em>intended</em>
entry point and platform setup. Exercise one minimal visible result, not
merely a successful object-file compilation.</li>
  <li>Make it clear where lifted game source, platform adapters, raw binary
analysis, assets, and reference source belong. The agent should be able to
find each without treating reference code as the original program.</li>
</ol>

<p>That environment is the <strong>source-lifting sandbox</strong>. Its restrictions are
practical: use the selected platform facilities; don’t pull in an unrelated
graphics, audio, or device stack because it seems convenient. If the observed
program needs a facility not accounted for, surface that gap and determine the
smallest real boundary, rather than silently expanding the target. The sandbox
is a known starting point, not a claim that every dependency is already
understood.</p>

<p>For IIDX for example, the substitute runtime is supposed to stand in for
hardware that is not physically connected. A call to download firmware to an
I/O board might still be part of the lifted startup path; it need not trigger
a new USB device implementation before the first screen can run. This is a
slice-specific choice to model the response at a platform seam, and must be
marked as such. Likewise, using a System 573 emulator as a runtime oracle or
a source of interface evidence does not require importing its FPGA emulation
into the reconstructed game.</p>

<h2 id="workflow-corpus" class="workflow-heading">3. Authenticate, analyze, and build a searchable raw corpus</h2>

<p class="workflow-return"><a href="#map-corpus">↩ Back to map: evidence</a></p>

<p>Identify the exact release and hash the executable, data, and analysis database
so evidence cannot silently drift between revisions. Keep original inputs
unchanged. Analyze the executable and code-bearing dependencies; extract a
function-level decompilation corpus with stable links back to binary identity (addresses,
module, or other identifiers). Preserve uncertain names and decompiler
artifacts as uncertain. Store the corpus next to the work so an agent can
search it cheaply, but <strong>do not build or link it as game code</strong>. Repeatedly
requesting the same decompilation through a tool is slow, can eat up your token budget faster, and makes it harder to
inspect the larger call graph. A key optimization here was to make it as cheap/easy as possible for the agent to read and browse this data.</p>

<p>Account for recognized functions, relevant data, and executable ranges: each
needs one source owner or an explicit unresolved classification. That map
prevents silent omissions and duplicate implementations; it is not a fidelity
score or a demand to translate the whole binary before choosing a slice.
An unresolved classification keeps a gap visible; it does not satisfy the
eventual goal of lifting all code. The tracer determines the order of work,
not which original functions can be permanently omitted.
Return to the original binary and disassembly when the decompiler output is
ambiguous; a pretty C rendering is not itself evidence of semantics.</p>

<h2 id="workflow-slice" class="workflow-heading">4. Choose the first connected slices</h2>

<p class="workflow-return"><a href="#map-slice">↩ Back to map: destination</a></p>

<p>A <strong>tracer bullet</strong> (see Hunt &amp; Thomas’ “The Pragmatic Programmer”) here means a narrow path through the real program from a
defined entry to an observable result. It goes through the necessary code and
platform seams; it is not a horizontal sweep of every renderer function or
every device driver. A workable order for these arcade games is:</p>

<ol>
  <li><strong>Startup to the first warning or visible screen.</strong> Establish entry,
initialization, essential asset loading, hardware/device initialization and checks, and rendering. This is commonly referred to as “application boot”. Include required
failures on that path; exclude unrelated devices and sound playback unless
the visible outcome really depends on them.</li>
  <li><strong>Operator/test menu.</strong> Render it and navigate it with input. Lift the
encountered calls into storage, sound, I/O, or other device boundaries,
while deciding explicitly which device checks may provisionally pass.
Text, textures, or 3D tests belong in this slice only to the extent needed
for its stated observable end state.</li>
  <li><strong>Normal game flow, split again.</strong> Attract loop; credits and player’s game session start; selecting different game modes and
song selection; starting a song; gameplay; results, game credits and game over. Each
slice gets its own entry, end observation, required behavior, exclusions,
and comparison against the original where possible.</li>
</ol>

<p>“Operator/test menu” is not automatically one small task. If a menu contains more
tests than a single bounded slice can exercise honestly, select a reachable
screen and navigation path first and extend it incrementally.</p>

<p>Here, all the domain and design documents that were created prior provide the agent with context to make it “understand” these given path well enough to make execute meaningfully on the tracer bullet. This part contributes significantly to enabling the agent to also understand and detect runtime defects on the A1 fidelity tier.</p>

<h3 id="example-an-operator-menu-slice-brief">Example: an operator-menu slice brief</h3>

<blockquote>
  <p><strong>Outcome:</strong> From the established startup path, reach the operator menu,
render its initial screen, navigate between defined entries using the
intended input source, and return to the initial screen.</p>

  <p><strong>Include:</strong> Lift the code actually traversed; retain calls into sound,
storage, and device-check interfaces at explicit platform seams. Implement
only enough boundary behavior for the selected checks to complete.</p>

  <p><strong>Exclude for this slice:</strong> Sound playback, a full storage implementation,
FPGA or I/O-board emulation, and tests on menu branches not being exercised.
“No playback” does not mean dropping the sound submenu call path.</p>

  <p><strong>Check:</strong> Build and run the connected application. Record the menu screens,
input transitions, which responses were stubbed, and which observations
were compared with the original runtime. A passing stubbed hardware test is
<em>not</em> evidence of device fidelity.</p>

  <p><strong>Stop and ask:</strong> If the lifted calls expose a material contradiction in the
platform boundary or require a different target architecture, report the
exact call and observation, alternatives, and impact. Do not stop merely
because physical hardware is absent when its substitution was agreed.</p>
</blockquote>

<p>This is a structural template for a <em>decision</em>, not a license to hard-code success for
every hardware test. This is not a fully fledged out prompt to establish an entire
tracer bullet session context. Choose responses based on the slice and make the
substitution inspectable. Where an actual check is necessary to the claimed
outcome, implement or verify it instead of bypassing it.</p>

<h3 id="give-the-agent-a-bounded-job-and-a-useful-way-to-stop">Give the agent a bounded job and a useful way to stop</h3>

<p>Before sending a slice to an agent, write a concrete brief: starting state,
end observation, code evidence to follow, allowed platform interfaces,
runtime oracle, verification, and explicit out-of-scope behavior. A plan can
refer to the lifting workflow and its stages without turning every action into
a new persistent status file.</p>

<p>The feedback is what makes autonomy useful. Binary-grounded source limits
invention, platform boundaries limit where substitution is allowed, and tests
that distinguish plausible implementations make shortcuts harder to hide.
Where no available check settles a question, more agent iterations are not
evidence that it has been solved.</p>

<p>One way I have worked is to send that brief to a fresh OpenChamber session
running OpenCode, then use OpenChamber’s goal feature to keep it working toward
the same bounded outcome. This is an operator choice, not a requirement of
source lifting. A goal must not reinterpret “keep going” as permission to
cross a security boundary, change the target, fabricate fidelity evidence, or
implement an entire device emulator. If the slice is done, stop and report
the result rather than inventing more work.</p>

<p>When a human decision really is needed, state it in (software) engineering terms to drive problem solving based on rational and trade-offs:</p>

<blockquote>
  <p>The lifted card-reader call reaches address/interface X, but the proposed
platform adapter assumes Y. With the original-runtime input Z, the menu
remains blocked after the check. Option A changes the adapter and these
call sites; option B narrows the slice. Which boundary should we use?</p>
</blockquote>

<p>Replace X/Y/Z with observed specifics. Say what was attempted, why the agent
cannot safely choose, the smallest options and consequences, and a recommended
choice when evidence supports one. A structured question with selectable
answers is easier to resolve remotely (on the phone) and keeps my own cognitive load lower than an unexplained “blocked on
evidence” message. Do not present routine missing-hardware calls as blockers
if the agreed platform substitute already covers them.</p>

<h2 id="workflow-lift" class="workflow-heading">5. Lift and connect the reached code</h2>

<p class="workflow-return"><a href="#map-lift">↩ Back to map: reconstruction</a></p>

<p>Starting from the agreed entry, inspect the minimum sufficient original
instructions, decompilation, callers, callees, and data to write provisional
compilable source. Preserve widths, signedness, layout, calling conventions,
ordering, failures, and original quirks. Follow the <strong>control-and-data
dependencies</strong>, not just one observed call stack: an indirect dispatch table,
callback, resource, or shared-state producer may be essential to the path.</p>

<p>Connect the reached functions through real calls and shared state in the
target application. Merely linking their object files together does not
establish that integration. Reuse existing source owners rather than adding a
second implementation of the same original address. Build, test, and run small
increments; return to analysis when the next dependency is uncertain.</p>

<p>Mechanical translation and semantic understanding develop together along the
slice. Compilable provisional source is useful progress, not an A0 claim.
Recover meaningful structures and names when the evidence supports them, but
do not replace unfamiliar behavior with a plausible new game design.</p>

<h2 id="workflow-platform" class="workflow-heading">6. Resolve only the platform contacts the slice reaches</h2>

<p class="workflow-return"><a href="#map-platform">↩ Back to map: platform</a></p>

<p>A reached library, operating-system, or device call is a question about a
specific boundary—not a requirement to implement the entire old platform.
First inspect the original caller and service: inputs, outputs, side effects,
timing, ownership, ordering, and failure behavior. Reuse a reviewed contract
if it already covers that contact. Otherwise realize the smallest supported
native service while retaining game rules and sequencing in the lifted code.</p>

<p>The IIDX Win32-based lift must preserve its reached DLL/Win32/DirectX and ABI contracts;
the System 573 port needs native replacements for reached platform services that are form to the System 573 hardware.
Neither calls for a generic device emulator. Deliberate substitutions need
an explicit agreed purpose and limitations. A temporary response for an
unsupported cabinet check is not proof of that device’s behavior, nor blanket
permission to return success elsewhere.</p>

<p>If essential behavior remains unknown, stop at the exact unsupported contact
and report what evidence is needed. Keep that diagnostic seam distinct from
a working platform implementation; do not silently discard writes or invent
values merely to reach the next screen.</p>

<h2 id="workflow-diagnose" class="workflow-heading">7. Run the connected path and diagnose its frontier</h2>

<p class="workflow-return"><a href="#map-diagnose">↩ Back to map: feedback</a></p>

<p>Run through the intended application entry with known inputs and starting
state. Use the <a href="#the-game-loop-debugger">game-loop debugger</a> to exercise the
currently scoped source lifting slice and inspect its visible result, state transitions, video, and audio where
available. Identify the first precise frontier: a successful exit, unsupported
contact, attributable defect, or divergence from the original reference.</p>

<p>Observe early, while lifting—not only after all reconstruction is complete.
A startup failure or wrong output can reveal a mistaken ABI, state producer,
resource choice, or platform assumption more cheaply than further speculative
implementation. Feed the observation back into the relevant source and
original analysis. An exact stop is useful evidence, but moving between stops
is not a substitute for reaching the agreed visible outcome.</p>

<p>Pre-review comparisons are diagnostic. Apparently matching images do not
establish passing A1 fidelity, and an unaligned or non-repeatable run must remain inconclusive
rather than being treated as either a pass or a proven reconstruction defect.</p>

<h2 id="workflow-review" class="workflow-heading">8. Review and compare a bounded result</h2>

<p class="workflow-return"><a href="#map-review">↩ Back to map: bounded claims</a></p>

<p>At a coherent connected boundary, obtain independent review against the
identified original instructions and data, maintained tests, source, and
native observations. Record limitations and unresolved behavior. This is the
bounded <a href="#fidelity-tier-a0-static-fidelity-identity-grounded-reconstruction">A0 evidence</a> described earlier;
it does not have to gate every provisional source increment.</p>

<p>Then compare a controlled original/rebuilt scenario for
<a href="#fidelity-tier-a1-runtime-fidelity-in-the-development-environment">A1</a>. Pin the builds,
reference environment, inputs, starting state, and observation points. Prefer
a useful connected sequence with meaningful checkpoints, narrowing to a
smaller probe when reachability, determinism, or attribution requires it.
Reuse unaffected evidence rather than rerunning unrelated checks ceremonially.</p>

<p>State which transitions and outputs were actually observed. Static agreement
does not prove runtime timing; runtime agreement does not prove unseen branches.
Further documentary or physical-hardware evidence answers selected remaining
questions—it is not an automatic next rung for every function.</p>

<h2 id="workflow-advance" class="workflow-heading">9. Correct, reverify, and advance along the tracer</h2>

<p class="workflow-return"><a href="#map-advance">↩ Back to map: next increment</a></p>

<p>For an attributable mismatch, form a concrete hypothesis, make a bounded probe,
apply the supported correction, and rerun affected checks. A claim-relevant
source or platform change needs the relevant review and comparison again;
an old passing result cannot cover a new implementation automatically.</p>

<p>Do not turn every minor residual into an unlimited investigation. If a gap is
bounded and does not compromise safety, essential semantics, shared contracts,
or the next path, retain its exact limitation and a reason to revisit it.
Deferral does not make the affected claim pass. A blocking unknown requires
evidence or a scope decision, not an invented implementation.</p>

<p>Then choose the next coherent slice toward the same tracer destination. Extend
the connected runtime rather than starting an unrelated collection of easy
functions. Once the tracer’s slices are covered, check their combined flow:
passing local checkpoints alone does not establish a complete playthrough or
whole-game fidelity.</p>

<h2 id="after-functional-convergence-closing-the-remaining-gaps">After functional convergence: closing the remaining gaps</h2>

<p>Following the connected paths is how I want to reach the first major milestone,
not my final definition of a completed source lift. Human QA is useful now,
but I do not want the remaining work to depend only on me finding problems by
playing the game over and over again. Several possible approaches deserve investigation:</p>

<ul>
  <li><strong>Reconcile code completeness against the original.</strong> Check executable code
regions and function discovery as well as the source-owner map. An initial
decompiler inventory may miss functions; an accounted-for function may still
be unresolved or only provisionally reconstructed. Include error handling,
alternate modes, indirect calls, and code unreachable through ordinary play.
Compiling a function or assigning it an owner does not establish its semantics.</li>
  <li><strong>Resolve explicit uncertainty.</strong> Review TODOs, accuracy-unverified notes,
hypotheses, known defects, provisional substitutes, and guarded stops. These
markers are leads for investigation, not a complete inventory of possible
mistakes. Removing a marker is not a correction: retain the supporting
original evidence, affected checks, and any limitation that remains.</li>
  <li><strong>Develop a golden set of scripted runtime integration runs.</strong> Reuse the
current test setup where useful to specify scenarios, starting state,
settings, input schedules, checkpoints, and expected observations. A future
direction is to run such a set with Ludaro when it is ready; that is not a
capability established here. Expectations need grounding in the original,
not just snapshots that bless whatever the rebuilt game currently does.
Randomness and timing alignment still limit which comparisons are conclusive.</li>
  <li><strong>Turn QA findings into targeted regressions.</strong> Where practical, reproduce a
reported defect in a supported runtime scenario or a focused test. For code
application runs seldom reach, targeted original/rebuilt comparisons and
boundary or failure cases may reveal differences that another full
playthrough would miss. Their applicability and cost still need evaluation.</li>
</ul>

<p>These are candidate closure methods, not an established tenth workflow step
or a claim that a golden test set proves the entire game correct. I have not
yet determined their effectiveness, the final completion criteria, or how to
combine complete code reconstruction with sufficient behavioral evidence to
justify moving into the next major phase. “100% done” needs a defensible scope
and evidence standard; it cannot simply mean no TODOs, a full function count,
or one successful playthrough.</p>

<h2 id="audit-output-not-activity">Audit output, not activity</h2>

<p>Long unattended runs can burn time on agent-only progress machinery. Status
documents, confidence levels, and complex tracking schemes may look useful,
but ask what decision they enable. For this work, a small lookup such as “was
function F lifted?” and “was it exercised in the running path?” can be more
valuable than a detailed, constantly updated ledger.</p>

<p>When progress feels slow, sample a bounded session window: what did the
repository and runtime evidence show at the start and end? Classify the work
in between by an explicit scheme—for example, source lifting, integration,
runtime checking, documentation, and agent-only machinery. Inspect what was
actually done inside the largest category, not just its label. That is how to
distinguish a useful boundary tool from repeated bookkeeping. My concern
about machinery came from inspecting sessions, not from the assumption that
all tracking is waste. A percentage quoted without a window, category rules,
and source records would be misleading.</p>

<p>My own setup used OpenChamber/OpenCode on a remote machine so a run could
continue when my laptop was closed and I could handle decisions by phone.
Lean-CTX reduced repository-context overhead and saved a lot of tokens; REkit supplied binary-analysis
tools. I disabled shared Lean-CTX knowledge in my multi-project configuration
after observing context drift between unrelated projects. This is a
configuration-specific experience, not a necessary feature of the method.</p>

<h2 id="time-model-choice-and-honest-unknowns">Time, model choice, and honest unknowns</h2>

<p>The exploratory phase cost time and tokens: building the environment, defining
the lifting workflow, debugging runtimes, and correcting agent behavior all
happened alongside real lifting. It is worth separating that cost from later
execution <em>after</em> the sandbox and slices were defined. A fair retrospective
would inspect dated session records for the first experiments, choose an
explicit cutover for each project, and report model usage, tokens and elapsed
time on both sides. The recent operator-menu work on DDR and startup
rework on IIDX are possible cutover candidates, not verified dates in this
draft. Subscription limits and parallel work on other projects make a simple
“cost per game” claim unreliable.</p>

<p>The work discussed here primarily used OpenAI models (sol-5.5, sol-6.0, sol-6.1) on medium (majority) or high
reasoning settings; the exact model IDs, settings, and distribution of work
need to be checked against session records before publication. Stronger
reasoning did not obviously solve the environment and scoping mistakes for
me. I have not established how smaller or local models compare on equivalent
slices. Better context handoffs, an orchestration tool, and worktree-based
parallelism are possibilities, not demonstrated speedups; concurrency also
adds integration costs and can make the first game harder to finish.</p>

<h2 id="summary-adapting-the-method">Summary: Adapting the method</h2>

<p>For another game or application, if you want to adapt this method, I would recommend the following steps:</p>

<ol>
  <li>Describe what it does and which behaviors must remain faithful.</li>
  <li>Inventory binaries, assets, reference material, legal access, and a
controllable original runtime if one exists.</li>
  <li>Document the intended compiler, SDK, libraries, and application-visible
hardware seams. Distinguish observations from hypotheses.</li>
  <li>Prove a small real application builds and runs on the intended target.</li>
  <li>Extract an indexed raw corpus without linking it as source; lift functions
into a separate compiling and then connected body of code.</li>
  <li>Select one visible path and explicitly bound its allowed stubs and excluded
subsystems.</li>
  <li>Run both sides where possible and report what matched, what was stubbed,
and what remains unknown.</li>
  <li>Review an agent run’s actual outcomes before adding more tracking or
automation.</li>
</ol>

<p>The goal is not to copy my System 573 boundary or Bemani PC substitute-runtime setup.
It is to give an agent the specific platform its code must inhabit, a narrow
connected outcome to pursue, and an honest way to know what it has proven.</p>

<hr />

<p>Next in the series: <a href="/arcade/beatmaniaiidx/hardware/llm/dancedancerevolution/reverse-engineering/2026/10/19/llm-assisted-source-lifting-and-game-porting-3.html">Part 3: Two games, one workflow, and what runs today</a>.</p>

<!-- Before publication: check platform/SDK terminology and project-specific
     observations against bpc2dx and k573rntm; add a real code/evidence example
     and checked debugger invocation/capture examples; identify the exact game,
     MAME, bemanitools and hook revisions plus relevant known limitations;
     substantiate the timeline,
     model names, token/time measurements, and any fidelity claims from session
     records; add verified primary references and acknowledgment links. Avoid
     presenting illustrative slice responses as observed historical results. -->]]></content><author><name></name></author><category term="arcade" /><category term="beatmaniaiidx" /><category term="hardware" /><category term="llm" /><category term="dancedancerevolution" /><category term="reverse-engineering" /><summary type="html"><![CDATA[This post is the second one in a series of me sharing my knowledge and learnings so far on leveraging LLMs in reverse engineering (arcade) video games. This is a significantly longer and more technical deep dive into how things were done and why.]]></summary></entry><entry><title type="html">BeatmaniaIIDX arcade control deck armrest fix and replace leather</title><link href="/arcade/beatmaniaiidx/hardware/2023/06/13/iidx-deck-armrest-fix-leather.html" rel="alternate" type="text/html" title="BeatmaniaIIDX arcade control deck armrest fix and replace leather" /><published>2023-06-13T16:00:00+00:00</published><updated>2023-06-13T16:00:00+00:00</updated><id>/arcade/beatmaniaiidx/hardware/2023/06/13/iidx-deck-armrest-fix-leather</id><content type="html" xml:base="/arcade/beatmaniaiidx/hardware/2023/06/13/iidx-deck-armrest-fix-leather.html"><![CDATA[<p>Documenting how I fixed the broken armrest of the control deck on my Beatmania IIDX cabinet as well
as replacing the worn and damaged leather covering it.</p>

<p>This seems to be one of those things that many IIDX cabinets experience in their life cycle. Due to
abuse, e.g. sitting on it, the armrest of the control deck breaks lose. The leather of the armrest
becomes sticky due to age or has holes either due to abuse or just by accident.</p>

<p>With a few hours to spare and some tools, these can be fixed fairly easy though.</p>

<p>Excuse my terrible <del>Photoshop</del> Gimp skills. I redacted parts of the pictures below for privacy
reasons.</p>

<h2 id="tools">Tools</h2>

<p>I used the following tools</p>

<ul>
  <li><strong>Hex screwdrivers/keys</strong> in different sizes to remove the control deck screws</li>
  <li><strong>Philips screwdriver</strong>: I needed that because the previous owner already “fixed” the armrest but
it wasn’t well done at all</li>
  <li><strong>Wood clamps</strong> to fixate the glued back wood slat</li>
  <li><strong>Box cutter</strong> to cut and remove excess material</li>
</ul>

<p>Also recommending a large and clean table. You do not want to do this on the floor… your back
will thank you.</p>

<h2 id="materials">Materials</h2>

<ul>
  <li><strong>Wood glue</strong></li>
  <li><strong>Wood slat</strong> for clamping down to not damage the wood of the control deck</li>
  <li>Additional <strong>wood slats + screws</strong>: Optional, but creating a more supportive structure for holding
the armrest</li>
  <li><a href="https://a.co/d/fRrHAEz">Leather Patch Kit, Self-Adhesive</a> or similar
    <ul>
      <li>Width at least 130 cm, length 40 cm</li>
    </ul>
  </li>
  <li><strong>Isopropyl</strong></li>
  <li>Old but clean <strong>piece of cloth</strong> for wiping away glue remains</li>
</ul>

<h2 id="taking-apart-the-deck">Taking apart the deck</h2>

<p>Exploded drawing of the control deck from a cabinet manual for reference:</p>

<p><img src="/assets/2023-06-13-iidx-deck-armrest-fix-leather/manual-deck.jpg" alt="" /></p>

<p>Remove in order:</p>

<ul>
  <li>Both 7 key panels: (8)</li>
  <li>Coin slot panel: (7)</li>
  <li>Turn table panels: (10) + (9)</li>
  <li>Chrome side covers: (3) and (4)</li>
  <li>Remove 6x nuts from the inside to remove armrest (2)</li>
</ul>

<p>Depending on how broken the armrest is, it might already come off like that because the the wooden
slat holding is broken.</p>

<h2 id="the-damage">The damage</h2>

<p>Mine looked like this with the lose wooden slat put on top of the deck:</p>

<p><img src="/assets/2023-06-13-iidx-deck-armrest-fix-leather/deck-4.jpg" alt="" /></p>

<p>Close-ups of what was supposed to hold the armrest, and of the damaged old/stock leather on the
armrest:</p>

<p><img src="/assets/2023-06-13-iidx-deck-armrest-fix-leather/deck-1.jpg" alt="" /></p>

<p><img src="/assets/2023-06-13-iidx-deck-armrest-fix-leather/deck-2.jpg" alt="" /></p>

<p><img src="/assets/2023-06-13-iidx-deck-armrest-fix-leather/deck-3.jpg" alt="" /></p>

<h2 id="re-attaching-the-armrest-wood-slat">Re-attaching the armrest wood slat</h2>

<ul>
  <li>Check if there are any old glue remains and remove them with the box cutter or a flat head screw
driver</li>
  <li>Apply wood glue to the deck where the lose wood slat goes and to the slat itself</li>
  <li>Put it back and ensure it faces the right way around or the holes for the armrest might not fit
later</li>
  <li>Put a long wood slat on the deck and use wood clamps to carefully apply pressure until the wood
glue gets squeezed out from the cracks (see picture below)</li>
  <li>You might want to use a few more wood clamps than shown on the picture to ensure pressure is
applied evenly along the entire length of the deck</li>
  <li>Wipe away the excessive glue with a light wet towel</li>
  <li>Let everything sit and dry as stated on the wood glue instructions</li>
</ul>

<p><img src="/assets/2023-06-13-iidx-deck-armrest-fix-leather/deck-5.jpg" alt="" /></p>

<h2 id="additional-re-enforcement">Additional re-enforcement</h2>

<p>I forgot to take proper pictures of that part. I hope the following annotated picture will do the
job and supports my explanations below:</p>

<p><img src="/assets/2023-06-13-iidx-deck-armrest-fix-leather/deck-6.jpg" alt="" /></p>

<p>The armrest wood slat is not well supported by default and might break off again easily. I cut a few
short wood slats, ~10 cm, and screwed them inside the deck below the coin panel (2). Another screw
goes through the wood slat for the armrest into the supporting slat (X on 2). The previous owner
already supported with additional slats at the turn tables (1). I improved that solution by using
better (and shorter) screws. The slats are held by screws that are visible from the top of the deck
but are hidden by the turn table panel when everything is fully assembled.</p>

<h2 id="removing-the-old-leather-from-the-armrest">Removing the old leather from the armrest</h2>

<p>I haven’t taken pictures of the work in progress of this. With the armrest off, it becomes visible
that the stock fabric is just glued to some foam that is glued to the metal armrest. Slowly and
carefully remove the leather by pealing it off starting on one edge. The older the glue, the easier
it might come off but be prepared for some nasty stickiness from the old glue.</p>

<p>Once the old leather is off, I used an old but clean piece of cloth and some isopropyl to remove 
further glue remains from the metal and carefully wiped the foam as well. The surface needs to be
fairly clean and smooth so the new leather does stick properly.</p>

<h2 id="applying-the-new-leather">Applying the new leather</h2>

<p>Cut the new leather in length but leave some excess/buffer. Be aware that some of the leather must
fold over to the inside to create a clean finish. Do not cut it to the exact length and width of the
armrest. You can always remove excessive material at the end with a sharp box cutter.</p>

<p>It might be a good idea to get a helping hand for this. The tricky part is to apply the leather
cleanly and avoid wrinkles and (air) bubbles.</p>

<p>Put the new leather on the table so the covering foil that covers the glue faces up. Remove part of
the foil, about 5-10 cm width, on the full length. Take the armrest and slowly put it on the leather
with the bottom edge and roll it apply the first 5-10 cm of leather to it. Turn around the armrest
and check for wrinkles. Carefully remove the leather a bit again and smooth out wrinkles and bumps
with your hand.</p>

<p>Ensure to have some of the leather go beyond the armrest. Folding that over to the inside is done
at the very end.</p>

<p>Continue peeling off the covering foil from the armrest continuously, keep applying the leather
to the armrest and keep smoothing out bumps and wrinkles.</p>

<p>Once you went around the entire armrest, you should have at least 2-3 cm more leather going beyond
the armrest’s edges. Fold it over to the inside. At corners and at the rounding part, you need to
carefully introduce cuts to create clean overlaps (see the picture above of the old armrest).</p>

<h2 id="putting-everything-back-together">Putting everything back together</h2>

<p>Re-assemble in reverse order. Final pictures:</p>

<p><img src="/assets/2023-06-13-iidx-deck-armrest-fix-leather/deck-7.jpg" alt="" /></p>

<p>No gap between the armrest and the deck anymore \o/</p>

<p><img src="/assets/2023-06-13-iidx-deck-armrest-fix-leather/deck-8.jpg" alt="" /></p>]]></content><author><name></name></author><category term="arcade" /><category term="beatmaniaiidx" /><category term="hardware" /><summary type="html"><![CDATA[Documenting how I fixed the broken armrest of the control deck on my Beatmania IIDX cabinet as well as replacing the worn and damaged leather covering it.]]></summary></entry><entry><title type="html">BeatmaniaIIDX arcade turn table slipmat mod</title><link href="/arcade/beatmaniaiidx/hardware/2023/06/13/iidx-turn-table-slipmat-mod.html" rel="alternate" type="text/html" title="BeatmaniaIIDX arcade turn table slipmat mod" /><published>2023-06-13T14:00:00+00:00</published><updated>2023-06-13T14:00:00+00:00</updated><id>/arcade/beatmaniaiidx/hardware/2023/06/13/iidx-turn-table-slipmat-mod</id><content type="html" xml:base="/arcade/beatmaniaiidx/hardware/2023/06/13/iidx-turn-table-slipmat-mod.html"><![CDATA[<p>Improving the Beatmania IIDX turn table “slipness” using a felt-based vinyl turn table slip mat.</p>

<p>The turn tables on my IIDX machine were never in great shape when I received my cabinet. The parts
that create the “slipness” wear off over the years of usage, and the turn table becomes harder to
spin or even trigger in the game.</p>

<p>For reference, on a stock (old style cabinet) IIDX turn table, the parts in question are (8) and
(9) shown in the following explosion view from a cabinet manual:</p>

<p><img src="/assets/2023-06-13-iidx-turn-table-slipmat-mod/iidx-tt-explosion.png" alt="" /></p>

<p>You can buy replacement parts online, e.g. from yahoo auctions, but these are often used/old as
well because they might be coming from butchered cabinets. New and original parts are hard to come
by if you are not an arcade distributor in Japan.</p>

<p>Using regular turntable/vinyl slip mats and cutting them to the appropriate size works as a great
alternative. Made of felt, their actual purpose on a (real) turn table deck is to let the vinyl slip
on the turn table when it is being held, e.g. for scratching.</p>

<p>Typically, you can buy these in music stores, on Ebay or Amazon. I bought the 
<a href="https://www.thomann.de/de/technics_slipmat_simple_t2.htm">Technics Slipmat Simple T2 pair from thomann</a>
which were the cheapest ones available there. Since the mats will be covered by the turn table top
disc on the IIDX, the design isn’t relevant.</p>

<p>After you cut it to the appropriate size, place it with the felt facing up. I used the old plastic
ring as a mask to mark the cutting line on the slip mat. Make sure it is slightly smaller than the
stainless steel turn table based so it does not get jammed when you screw the top disc back on.</p>

<p>Here is what mine looks like after cutting the slip mat and putting it on the stainless steel 
turn table base (with the top removed):</p>

<p><img src="/assets/2023-06-13-iidx-turn-table-slipmat-mod/iidx-tt-2.jpg" alt="" /></p>

<p><img src="/assets/2023-06-13-iidx-turn-table-slipmat-mod/iidx-tt-1.jpg" alt="" /></p>

<p>Note that this does NOT fix any friction issues related to bad lubrication of the turn table
bearings or screwing down the top disc too tight.</p>]]></content><author><name></name></author><category term="arcade" /><category term="beatmaniaiidx" /><category term="hardware" /><summary type="html"><![CDATA[Improving the Beatmania IIDX turn table “slipness” using a felt-based vinyl turn table slip mat.]]></summary></entry><entry><title type="html">First post, let’s start somewhere</title><link href="/misc/2023/06/13/first-post.html" rel="alternate" type="text/html" title="First post, let’s start somewhere" /><published>2023-06-13T12:00:00+00:00</published><updated>2023-06-13T12:00:00+00:00</updated><id>/misc/2023/06/13/first-post</id><content type="html" xml:base="/misc/2023/06/13/first-post.html"><![CDATA[<p>You have to start somewhere and it’s often hard to make the first step. This blog took me a few
hours to setup and get running due to several “small” issues. But it’s done, it’s somewhat simple
and hopefully serves my needs.</p>

<p>Being around the musicgame/Bemani arcade community since 2004 and a contributor on various larger
projects in the scene over the years, e.g. bemanitools, arcana, I realized there is different kinds
of knowledge that I seem to have and others in the community don’t.</p>

<p>I noticed questions regarding specific tech related topics keep coming back and I keep repeating
them in private chats. This way that information is not available to everyone and easily accessible.</p>

<p>I want to use this blog to share my knowledge that I acquired over the years instead of letting it
rot in my brain or in my private notes. Expect to see software and hardware related stuff as well as
misc things documented that I found useful or someone asked about.</p>]]></content><author><name></name></author><category term="misc" /><summary type="html"><![CDATA[You have to start somewhere and it’s often hard to make the first step. This blog took me a few hours to setup and get running due to several “small” issues. But it’s done, it’s somewhat simple and hopefully serves my needs.]]></summary></entry></feed>