Repository navigation
Add the PC-8801MC CD-ROM drive - #32
Merged
Merged
Conversation
The drive, its port interface and the CD BIOS mapping are derived from what CDBIOS.ROM does with ports 0x90-0x9F and 0x99 and with the bytes it gets back, plus SCSI-2 for the generic commands and ECMA-130 for the disc layout. Where a behaviour could not be pinned down the code says so with a TODO. - CDDisc: .cue (several files, PREGAP/POSTGAP) and .ccd images, raw 2352-byte sectors read on demand. - CDROMDrive: SCSI target with auto-acknowledged handshake, TEST UNIT READY, REQUEST SENSE, READ(6) by PIO or DMA channel 1, MODE SELECT for 2340-byte sectors, NEC D8/D9/DA/DD/DE audio and TOC commands, CD-DA at 44.1kHz through the fader, save state. - Pc88Bus: CD BIOS over 0x0000-0x7FFF (upper half with RMODE=1), port 0x99, DMA writes. - Machine/PC88: drive wiring, loadCDBios, cdDriveInstalled, mount and eject; boot strap stays on disk boot with the drive fitted. - YM2608: external sample source mixed into the output. - C ABI: b88_load_cd_bios, b88_set_cd_drive, b88_is_cd_drive_active, b88_mount_cd, b88_eject_cd, b88_cd_track_count, b88_cd_activity. - BootTester: BOOTTEST_CD_PATH and BOOTTEST_CD_TRACE. Mirrors boots from CD, builds its disks and plays its CD audio with fades. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A save state carries the drive's position but not the disc. mountCD starts the drive afresh, so restoring needs a way in that keeps the state: PC88.reattachCD(url:) and b88_reattach_cd. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The app loads the CD BIOS before every reset and needs to drop it when the file is no longer there, so the drive goes inactive instead of running on the copy loaded earlier. Exposed to the C ABI as b88_unload_cd_bios. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Mirrors patches the BIOS's D9 routine to send mode 1 and never reads sub-Q, so its music loops only if the drive repeats the range; the NEC drive in BubiC-8801MA has the same modes. Mode 0 now stops, and paused reads as 2 in sub-Q. Fader bit 0 selects a slow fade and a fade starts from the other end: the CD player writes 0 then 5 at the start of a track, which only fades in from silence, and stops at once after 6. Position type 0x00 takes a 24-bit LBA. The drive's save state layout moves to 2 and still reads layout 1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CD audio was mixed only into the stereo output, so a host playing the immersive stems heard no CD. AudioSamples.cd carries it on its own, and b88_drain_audio_stem drains it as stem 4. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.cue/.ccdのイメージに対応し、データ読み込み(DMA)と CD-DA の再生、フェーダーを実装cdDriveInstalled)。CD BIOS(CDBIOS.ROM)がないときはつながらないreattachCDで入れ直す。BIOS ファイルがなくなったときのためにunloadCDBiosを追加AudioSamples.cd、b88_drain_audio_stemの 4 番)b88_mount_cd/b88_reattach_cd/b88_eject_cd/b88_load_cd_bios/b88_unload_cd_biosなど)アプリ側は bubio/Bubilator88 の CD 対応 PR で使用します。
Test plan
swift test(1044 件すべて成功)scripts/regression_compare.py(20/20 PASS)🤖 Generated with Claude Code