Repository navigation
Conversation
A "C128 CARTRIDGE" file was routed by its first chip's load address, and only $0000 meant C128 mode. The CRT spec puts a generic C128 cart's ROML at $8000 and ROMH at $C000, so a spec .crt with an 8k ROML matched the C64 8k rule and started in C64 mode, and 16k or 32k ones never reached C128 mode at all. x128 refuses the $0000 layout. The signature now decides. A C128 crt maps an 8k or 16k chip at $8000 to ROML and one at $C000 to ROMH, with the ROM masks sized to each chip, and anything else is refused with a message. Nonzero C128 hardware types are refused instead of being looked up in the C64 list, where 1 means Action Replay rather than Warpspeed128. Both the main and minimal parsers change. The 789010 diagnostic cart in the menu moves its ROML to $8000, which is the copy of it the VICE manual uses as its generic C128 example.
The C128 layout rules move with StructCrtChip into a pure header, CrtChips.h, as MapC128Cart, which returns both images and their masks. The launch in both builds checks its result and refuses with a message instead of resetting into an empty cart. Both builds reset the ROM masks before every launch, since a direct remote launch skips SetUpMainMenuROM and would otherwise inherit a C128 cart's 16k masks. vm/tests/c128cart_test holds the accepted and refused layouts, run by verify:extensions.
MinimalBoot has no direct remote launch and its setup already sets the masks, so the per-launch reset there goes. A test comment claimed a check the test does not make.
The C128 signature, HW-type refusal, layout check and launch mapping move into MinimalBoot/Common/C128Crt.h, so the main and MinimalBoot images call the same code instead of carrying copies. The launch applies the map SetTypeFromCRT saved rather than checking the layout a second time.
A C128 crt can carry a TRCLOCK record (tools/c128/README.md). At launch the TR finds it in the cart's ROM image and, while the cart runs, writes its RTC's local date and time there every 100 ms, so a GEOS 128 crt built with geos128crt.py boots with the TR's clock.
This was referenced Oct 15, 2026
Contributor
Author
|
Closing: the clock record was only for Python-built GEOS 128 crts. GEOS 128 will launch the way GEOS 64 does, and the firmware writes the RTC time into the boot image at launch (GeosSetClock), so no crt needs a record the TR keeps updated. |
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.
Stacked on #59 (C128 .crt launch): the first commits here are #59's. Review the last three, starting at 9a798ca.
A C128 crt can carry a clock record: the tag
TRCLOCK, a version byte$01, then century, year (0–99), month, day, hour (0–23), minute and second. WhenLaunchC128Cartmaps the cart, it searches the ROML image (then ROMH) for the tag. While the cart runs, both images'loop()write the RTC's local time into the record every 100 ms; the time zone comes fromeepAdTimezone.FreeCrtChipsdrops the pointer, so nothing is written once the chips are freed. Chips that MinimalBoot swapped out to SD are skipped.The first user is GEOS 128. Built with
tools/c128/geos128crt.py(#60), its loader reads the record once GEOS is unpacked, then sets CIA1's TOD and GEOS's date from it. Before this, every boot started at 1:00 PM on 3/23/92. The record format and the C128 side are intools/c128/README.md, "The boot clock". The C128 reads until two reads agree, so a write landing mid-read is harmless.Verified
build:trandbuild:tr-plus(linux/amd64, Teensyduino 1.61.0).--clock 1999-01-01T00:00boots from a D81 on an SD2IEC. The DeskTop shows01/01/19 01:12 AM, which is the TR's RTC. That RTC was never set, so it started at the Teensy core's Jan 1 2019 default when it found the RTC stopped. Not tested: a set RTC, MinimalBoot, an original TR.Draft until the GEOS package is complete.