DEV Community

loach
loach

Posted on

PC Engine CD BIOS Devlog: Public IPL Wiring and a Narrow CD_READ FIRST-Mode Implementation

I'm working on oss-pce-cd-bios, an original open-source project aiming at a PC Engine / TurboGrafx-CD System Card replacement.

My November 16 update described three experimental services running in one image on synthetic CD media, including a real guest SCSI READ(6) that transferred 2,048 bytes.

As of November 18, 2026, that path has become more concrete. The merged work now includes a reproducible G5 development profile, a PUBLIC-format multi-sector IPL path wired to three experimental services, a two-base CD-address prototype, and an intentionally narrow CD_READ FIRST-mode implementation.

The central qualification remains unchanged: these are project-defined development contracts, not verified proprietary System Card APIs. No retail title screen, production BIOS, or commercial compatibility has been established.

A reproducible G5 profile without changing the standard DEV ROM

PR #799 introduced a dedicated G5 development profile that brings the ordinary DEV ROM's 18 project-defined routines together with experimental links for candidate slots $02, $03, and $33.

Instead of rewriting the existing image builder, the profile wraps the established experimental builder, records its provenance, and exposes make dev-g5 and a separate integration target. Tests check that the default DEV image is byte-identical to the previous build and that experimental slot wiring stays isolated.

This matters because adding an experimental jump-table redirect is not the same as promoting that redirect into an ABI-compatible, release-eligible firmware service.

Moving from PCEX experiments to a PUBLIC IPL route

Previously, much of the three-service chain relied on a project-specific PCEX payload format.

PR #801 connects a PUBLIC multi-sector IPL loader to the same experimental service family:

  1. Read the synthetic disc's IPL information and body sectors, validating layout and destination bounds.
  2. Transfer control to code loaded into guest RAM.
  3. Call experimental $02 CD_BASE, $03 CD_READ, and $33 EX_DSPOFF handlers through checked table wiring.
  4. Verify service effects, returns, stack/memory-map state, and fail-closed behavior for invalid selections or unimplemented entries.

The reported pinned Geargrafx integration included six synthetic real-core test cases across cold and warm conditions.

Here, PUBLIC describes the development loader's IPL-format path, not successful booting of a retail title. The PR explicitly did not open or inspect private commercial discs.

A two-base CD_BASE prototype

PR #805 adds a separately built experimental CD_BASE variant that maintains two base records and tracks their state.

One of the interesting engineering problems was a HuC6280 memory-aliasing trap: under the test's MPR configuration, zero-page addresses can alias work-RAM locations used for scratch or preserved data. A seemingly harmless save/restore loop can therefore overwrite inputs it has not yet read.

The revised implementation reads the required inputs before conflicting scratch writes, preserves the reserved scratch window, and rejects unsupported or invalid inputs. The PR reports 27/27 synthetic pinned-core cases passing.

That is useful evidence for the project-owned two-base contract. It does not demonstrate that either base-record representation matches the genuine CD_BASE ABI or that all commercial-disc address conventions are understood.

CD_READ FIRST mode: implement one well-defined slice

PR #806, merged on November 18 after PR #805, implements an experimental FIRST-mode CD_READ path. Its accepted caller conditions are intentionally narrow:

Property Development-only accepted value
Mode LOCAL / FIRST (_dh = 0)
Transfer size 2,048 bytes
RAM destination $2800
Other modes, sizes or destinations Refused

The code validates a trusted synthetic selection record and the required CD_BASE initialization state before proceeding. Unsupported modes and malformed state return defined failures instead of silently attempting a transfer. Refusal cases are tested for no unintended destination writes and balanced CPU/stack state.

There is an important test-design detail here: the test compares all 2,048 bytes, not just selected offsets. Earlier comparison gaps could have allowed corrupted data to pass. The merged fix uses a shared full-length comparison and mutations in the head, middle, previously unchecked region, and tail of the observed transfer.

The final PR report records:

  • 21 focused host tests passing.
  • 27 focused synthetic real-core CD_READ cases passing, plus 27 related two-base cases.
  • 5,630 host-suite tests passing and 166 full real-core tests passing under the pinned setup.
  • Required CI green, with the review fixes integrated before merge.

These are the PR's reported measurements, not tests independently rerun for this article.

Despite the PR's commercial naming, an opt-in commercial-disc retest for this FIRST-mode implementation was not performed in its test worktrees. Wider banked or multi-area read modes remain explicitly blocked. In particular, this is not proof of a retail CD_READ calling convention.

Keeping simulated call progression separate from actual execution

Another merged change, PR #803, adds a separate diagnostic variant where the unimplemented $4A slot is replaced with an immediate RTS, solely to find the next API call and stopping point.

Historical, explicitly opted-in local observations of two commercial CUEs showed that this SIMULATED return could move the stop point beyond $4A to later API entries. The ordinary G5 image is left intact, and neither the proprietary media nor identifying metadata is uploaded to public CI.

This experiment measures call flow. It does not implement the missing $4A service. The reports deliberately distinguish REAL development effects, SIMULATED returns, UNKNOWN genuine behavior, and BLOCKED unsafe execution.

Current status

The main-branch source manifest at 5b893616 (November 18) still has 18 out of 81 ordinary development API implementations. These counts have not increased since the last update: the progress this time is in connecting and testing existing experimental functionality.

Status axis November 18
Project-defined ordinary DEV implementations 18/81
Nonreturning fallback stubs 63/81
Independently VERIFIED reference ABI contracts 0/81
Permitted reference BIOS JSR entries 0/81
Owner-approved DEV_CALLABLE entries 0
Demonstrated retail title screens 0
Release eligibility false

The next milestone is not just “another slot returns.” It is establishing the next required caller-visible contract and showing that a real implementation performs its work without relying on simulated success or weakening the fail-closed safety gates.

What changed over these two days is tangible: the development project now has a more realistic IPL entry path, a better-defined CD address experiment, and a limited CD read service whose success and refusal behavior can be measured end-to-end on synthetic media.

Repository: https://github.com/mao2009/oss-pce-cd-bios

Related changes: G5 DEV profile #799, PUBLIC IPL wiring #801, two-base CD_BASE #805, CD_READ FIRST #806.

This independent project is unaffiliated with NEC, Hudson Soft, Konami, or other rights holders. It does not distribute proprietary BIOS images, commercial game data, or extracted copyrighted code.

Top comments (0)