Repository navigation
Conversation
kfox
left a comment
There was a problem hiding this comment.
I reviewed the engine on the host. I built small C programs against DiskImage.h with fake reader/writer callbacks; I did not test it on hardware. Three defects and one design note are inline. None of them can happen on a board yet, since nothing calls the engine, but VDrive's write path will reach all of them.
|
Thanks for the review, and for building against the engine on the host. The repros made each fix easy to pin down. All four points are addressed, each with a host test in
One more change you didn't raise: the
|
6ebd42c to
16c4b35
Compare
…VDrive will share The GEOS installer and the TR block device each carry their own image geometry, BAM and directory code, and VDrive brings a third, more complete engine (40-track D64s, error bytes, BAM and directory growth for all three kinds, tested against c1541). Bring VDrive's engine in under Source/Teensy/DiskImage so the other two can move onto it. Nothing uses it yet. The copy differs from teensyrom-vdrive's d64/ only in what the firmware needs: SPDX lines, the placement macros moving into d64.h, and its three constant tables marked D64_FLASH so they land in PROGMEM rather than DTCM. DiskImage.h includes the code once for the single translation unit the firmware and the host harnesses build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X5t9wWXadFkQgKaCnjreF7
16c4b35 to
6382e2a
Compare
This is part 1 of a series of PRs to streamline and consolidate disk image (.d64/.d71/.d81) access, which will then be used to power the VDrive Special IO. This is a big hunk of code by itself, which is why I'm separating it out like this.
Rationale
The GEOS installer and the TR block device each carry their own image geometry, BAM and directory code, and TDrive brings a third, more complete engine (40-track D64s, error bytes, BAM and directory growth for all three kinds, tested against VICE's
c1541). This brings TDrive's engine in underSource/Teensy/DiskImage/so the other two can move onto it.State of affairs after this PR
Nothing uses it yet. The copy differs from teensyrom-vdrive's
d64/(commitb74ce37) only in what the firmware needs: SPDX lines, the placement macros moving intod64.h, and its three constant tables markedD64_FLASHso they land inPROGMEMrather than DTCM.DiskImage.hincludes the code once, for the single translation unit the firmware and the host harnesses build.Follow-up PRs move the block device, then the GEOS installer and boot-file reader, then the TR menu's D64/D71/D81 loading and directory listing onto it.
Memory
VD_COLD, whichDiskImage.hdefines asFLASHMEMon the firmware. None of it is reachable from the PHI2 ISR or an IO handler's cycle path.PROGMEM.mallocand adds no globals: all state lives in structs the caller owns, so it holds nothing in RAM1 or RAM2 between uses.DiskImage.hyet, so this PR doesn't change the TR or TR+ images. The RAM cost will show up in the follow-up PRs that call it, and those will report it.Docs
docs/Architecture/Disk-Images.md: what the engine is, where it came from, how a caller uses it, the size-to-format table, and its tests.docs/Architecture/Overview.md.Testing
Source/Teensy/tests/disk-image.test.js, which builds the engine with the firmware's warning flags as both C and C++. On a blank image of each kind it saves a file and reads it back, and it checks the size-to-format table.npm testpasses, and CI is green on both firmware builds (tr,tr-plus) and the tools job.Compatibility
No change to the remote protocol (
docs/ControlComms.md), the cartridge register map, the EEPROM settings or any timing.License
The engine is my own work from teensyrom-vdrive, which is MIT licensed. The files here carry
SPDX-License-Identifier: MIT.🤖 Generated with Claude Code