Repository navigation
Conversation
The program sent its NTP request and then did a single socket READ. That only works if the reply is already queued when the READ runs. Newer Ultimate firmware answers an empty READ at once (status 02, count -1), so the program stopped with no data. Ask again until data arrives or 5 seconds have passed on clock(), and report "No reply" on timeout. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
Fixes #1
u-time.csends the request and does a singleuii_socketread(). An empty READ answers02,NO DATAwith count $FFFF, andCheckStatus()ends the program on it. So the program only works if the reply is already back when it reads. Firmware that waits 40 ms (3.12a to 3.15) gives a fast server that much time; firmware that answers an empty READ at once does not. From reading the firmware source, that is 3.0 to 3.11 (not tested), and it is the change proposed in GideonZ/1541ultimate#1087 (tested below).Change
u-time.conly, +15/-2:02, for up to 5 seconds measured withclock().00status still stops the program as before.clock()needs the KERNAL jiffy interrupt, which is running when the program starts from BASIC.Testing
Built with
cl65 -O -t c64andcl65 -O -t c128(cc65 2.18), no errors. The trackedtarget/PRGs and D64 are not rebuilt in this PR.For the tests I built the program with
hostinu-time.c(line 56) pointing at a local test server instead of pool.ntp.org; that change is not in the PR. I ran it on a C64 Ultimate (it reports itself as Ultimate 64-II) with each firmware loaded by JTAG (no flashing), and on an Ultimate 64 Elite with the no-wait firmware. The NTP server was a small script on the local network that answers every request after a set delay with a fixed time. A run counts as correct if the screen shows that time. Five runs per cell, correct runs out of five:The Ultimate 64 Elite on the no-wait firmware gave the same result at 0, 100 and 1000 ms (unchanged 5/5, 0/5, 0/5; this PR 5/5 at all three). An unchanged program ends with "Status: 02,NO DATA: 11"; the changed one sets the clock.
Written with Claude Sonnet 5.5 in Claude Code.