a2d icon indicating copy to clipboard operation
a2d copied to clipboard

New DA: No-Slot Clock control

Open inexorabletash opened this issue 8 years ago • 9 comments

Adjust time (and date) of NSC

inexorabletash avatar Oct 17 '17 01:10 inexorabletash

Good First Bug notes:

An ambitious approach would be extend the Date & Time (see #11) DA:

  • If the system has no realtime clock, just set the ProDOS date/time
  • Otherwise, determine which type of clock (NSC, Thunderclock, Dclock, Cricket, ...) and use appropriate code to set it.

A less ambitious approach would be to just make a control panel specific to the NSC, and let users figure it out. No shame!

inexorabletash avatar Aug 27 '21 03:08 inexorabletash

Added complication: some of the clock detection routines rely on trying to read the time and failing if the time is not valid. That would be a challenge if the goal of the DA is to let you initialize the RTC, rather than just adjust the time. The Cricket! driver works that way at any rate.

For The Cricket! and NSC a dedicated DA for setting the date/time with an explicit "pick the clock" option might make sense.

inexorabletash avatar Jan 13 '23 03:01 inexorabletash

For reading the NSC, wouldn't it be simpler to install the .SYSTEM driver? Seems to work for other prodos system disks.

buserror avatar Oct 20 '23 06:10 buserror

For reading the NSC, wouldn't it be simpler to install the .SYSTEM driver? Seems to work for other prodos system disks.

A multi-clock CLOCK.SYSTEM driver is already included. But that's for reading the clock, not setting it, which is what this issue is about.

inexorabletash avatar Oct 20 '23 11:10 inexorabletash

To clarify: if the goal of a DA is to set the clock, we first need to detect it. But the current detection logic in most drivers is to try to read the clock and get a valid time. If the time is not yet set, that would fail.

inexorabletash avatar Oct 21 '23 00:10 inexorabletash

I will have to look at the CLOCK.SYSTEM source, as it fails to detect the one in my emulator, which I've plonked on slot 1 -- it's detected by the NS.CLOCK.SYSTEM "Official driver" tho, so there must be a difference in probing. I've put it there because the driver probe looks there first! To detect it should be fairly easy, even with the clock not set, it will still return 64 bits of uninitialized clock I suppose, so will change the LSB of any ROM byte that is read to do the probe...?

buserror avatar Oct 21 '23 07:10 buserror

A2D includes the "jumbo" driver from https://github.com/a2stuff/prodos-drivers

inexorabletash avatar Oct 21 '23 13:10 inexorabletash

Isn't this something that ought to be in the driver? Ie currently the clock probes and install the clock reader routine, but there isn't a vector for a 'set' --- perhaps we'd need one somehow? That way the DA could look to see if there is a 'set', enable editing, and call the driver handler when done?

buserror avatar Jan 11 '24 13:01 buserror

In an ideal world, yes. But in practice, the driver is restricted to 125 bytes and ProDOS only defines reading the time, not setting it. There's no established practice for setting the time outside of bespoke utilities that shipped with each clock.

inexorabletash avatar Jan 11 '24 15:01 inexorabletash