Repository navigation
Conversation
… beside an REU Under an REU the registers move to $DE00, since the REU's own repeat across $DF00-$DFFF. A copy of the driver lives on the user's disk, in CONFIGURE's 1581 driver, and outlives a change of Special IO, so it looks for the TRB id at $DF10 and then $DE10 on every transfer instead of being told the page when it is installed. $DF10 comes first because $DE10 is GeoRAM's window, which can hold any bytes; an REU's unused registers read $FF there.
…r beside an REU Beside an REU, $DF03-$DF05 are its address registers, which hold whatever the last transfer left and so can read "TRM". The block device's TRB id at $DF10 picks the page instead: an REU's unused registers read $FF there, and GeoRAM's window at $DE10 is never asked.
… launch gives it The boot ROM is built at every launch, which knows which handler it starts, so the firmware writes the page into the ROM instead of the ROM searching for it: a glitch-safe search does not fit in the one page the cold start copies. geos128boot.mjs assembles the ROM at two pages and lists the bytes that move, as trdrive.py does for relocations. The launch still asks for the page beside GeoRAM.
…R as drive A CONFIGURE is what finds an REU and sets GEOS up to use it, so it has to run. Its drive-type probe now answers a 1581 at device 8 and nothing elsewhere, and the 1581 driver it installs for drive A, its record 4, gets the TR transport the boot image already has. The stock file is known by the target's name for it and by the probe in record 0, so a copy made before this, where CONFIGURE was retyped, is set up the same way. Anything else named CONFIG is still kept from running, including a CONFIGURE whose records are not laid out as the stock one. The synthetic test disk has one directory sector; the old CONFIGURE test put a ninth file past it, so its check that CONFIGURE.DOC stays as it was looked at a slot no directory held.
The copy outlives the firmware that made it, and a mouse driver from before the REU route reads $DF03 for its ID, which beside an REU is an address register. The driver is rewritten in place over its own blocks; one taking another number of blocks is refused with a message to delete the copy, since growing it means allocating on the user's disk.
The REU answers at $DF00 as before, and the USB mouse and block device move to IO1, the page an REU leaves free. A GEOS launch takes this handler when it is the Special IO setting, and GeoRAM otherwise, and builds the GEOS 128 boot ROM for the page that handler puts the registers on. Beside the REU, $DF0B-$DF1F read $FF, as a 1764's unused registers do, so the TRB id the GEOS drivers look for at $DF10 cannot appear there.
…d not at all without an REU The TR's GEOS drivers decide which page holds the block device by what $DF10 reads, and no test ran IO2Hndlr_REU_TRPage itself: dropping its $FF answer, its bank check or its 32-byte mirror left the suite green.
…osen for Both the C128 boot ROM's register page and the handler come from GeosIOHandler(), and no test held either: dropping IOHandlerSelectInit's GEOS branch puts GEOS under the item's GeoRAM while the boot ROM looks beside the REU, and the suite stayed green.
Giving GeosIsDriverAt and GeosReplaceTransport a second caller took them out of their inlined callers and into ITCM, 334 bytes on both TR and TR+, and the probe patterns and CONFIGURE names landed in DTCM. The build's memory report showed it; marking them FLASHMEM and PROGMEM, with GeosFindOnce and GeosBytesInBlock beside them, returns 320 bytes of RAM1 code on each target and leaves the TR's below where it was before the REU change.
kfox
marked this pull request as ready for review
October 30, 2026 01:29
This was referenced Oct 30, 2026
kfox
marked this pull request as draft
October 30, 2026 04:05
kfox
marked this pull request as ready for review
October 30, 2026 04:08
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.
GEOS 64 and GEOS 128 run with the TR+'s REU as their RAM expansion, found and set up by GEOS's own CONFIGURE, with the TR still drive A and no IEC drive.
What the user does. On a TR+, set Special IO to REU+USB Mouse/Disk in Settings, then pick GEOS 64 or GEOS 128 as before. With any other Special IO setting GEOS runs with GeoRAM, as it does now.
How it works
REU+USB Mouse/Disk, keeps the REU at$DF00and moves the USB mouse and block device registers to$DE00. Its unused REU registers read$FF, as a 1764's do, soTRBat$DF10tells the two layouts apart.TRBat$DF10, then$DE10. The boot ROM's page is written in by the firmware at launch.-TRcopy runs the stock CONFIGURE again. Its drive probe is patched to report the TR as a 1581 at device 8, and its 1581 driver record gets the TR transport. Copies made before this change, where CONFIGURE was put aside, are set up the same way. Any other CONFIG auto-exec, or a CONFIGURE not laid out like the stock one, is still kept from running.docs/TR_Block_Device.mddescribes the second page.docs/GEOS128_Usage.mdcovers GEOS 128.docs/GEOS64_Usage.mdand the GEOS 128 page share a "RAM expansion: GeoRAM or REU" section, which says which Special IO gives which RAM expansion on which board and recommends the REU on a TR+.docs/General_Usage.mdlists GeoRAM, 512KB REU and REU+USB Mouse/Disk under Special IO.README.mdlinks the GEOS 128 page.Verified on hardware on a TR+ in an NTSC C128, with no IEC drive:
ramExpSize= 8), drive A is the TR, DeskTop up.Dbg_SerTimChgbuild with a C64-mode loop reading the REU's address and length registers back,$DF10-$DF1F, and the TR page'sTRM/TRB, 8 s at each step (1,400 to 5,100 rounds a second, by layout), whilenS_PLApropis raised. From the default of 150, the stock 512KB REU handler first fails at 260, this handler at 250 (one error at 240), and GeoRAM's TR page, as shipped, at 240.Host tests. The disk and mouse drivers run on the 6502 emulator against a modeled REU and GeoRAM page, and the boot ROM with either page. The disk patcher tests cover the probe and driver records, the retyping, a copy set up by an earlier release, and the mouse refresh and its refusals. New harnesses cover the handler's IO2 page (the REU's registers,
$FFacross the rest of each 32 bytes, nothing without an REU) and which handler a GEOS launch runs under; each fails with the code it covers removed.npm testpasses 337 of 337 on macOS, and under GCC in a linux/amd64 node:24 container 295 pass with 8 skipped for tools and disks it lacks. The firmware builds for TR and TR+ in the same container.Reviewed at medium per change, with each review's fix commit at low, then a final medium pass over the branch, then a pass by Auditor, Adversary, Steward and Pragmatist lanes per the guidance in #79, whose fix commits got a low review. The docs commit was reviewed at low against the code; it changes no code (
git diff c9fceda3 5c8de5b7 -- ':!*.md'is empty).Memory, from CI's build of this head against main's: RAM1 code grows 832 B on the TR+, for the new handler's IO2 path, which the bus-cycle interrupt calls; it shrinks 64 B on the TR. RAM1 variables, free-for-locals and RAM2 are unchanged.