freitz85 / smwclock

2 stars 1 forks source link

Support for Tandy 1000 SL / SL2 / SLE machines #1

Open dJOS1475 opened 2 years ago

dJOS1475 commented 2 years ago

Hi Florian, any chance you could add support for machines that locate the DS1216E / DS1315 at address E0000 please?

I've had a look at the code and briefly flirted with changing the search starting point to A000h (that's the start of the BIOS ROM space on an 8088/86) but ran into a lack of knowledge when trying to assemble the code.

There is an existing utility (SLCLOCK non-y2k compatible) that does support the E0000 address location and I was able to decompile it - unfortunately with my limited ASM knowledge I couldn't work out why it works and SMWCLOCK doesn't.

https://www.dropbox.com/s/9ag7laqy9f1j4ev/SLCLK.LST?dl=0

regards Derek

PS, I make a modern replacement for the DS126E SmartWatch modules and I'd be happy to send you one as a thank you for updating this utility.

https://www.tindie.com/products/16640/

freitz85 commented 2 years ago

Hi Derek, thank you for the suggestion I will see what I can do. However, I won't be able to test it, because I don't have a Tandy 1000 and they are almost nonexistent in Germany.

dJOS1475 commented 2 years ago

Howdy, there are a bunch of my American friends and customers with them and they would be happy to help test modifications.

PS I’m an Aussie.

btw my offer still stands, I’d be happy to send you my XT compatible version as a thank you.

dJOS1475 commented 2 years ago

Hi Florian, while discussing this issue with some fellow Tandy enthuiasts, the following theory was put forward via the below conversation:

John: I kind of doubt the ROM being at E0000 is the problem. I’ve looked at the code before and I’m pretty sure the search routine already scrubs through the entire upper address space looking for it, there’s nothing in it to skip that segment. I would make an uneducated guess that maybe the problem is the bank switching hardware the SL machines have is defaulting to a different socket when you scan. (Which SLclock accounts for.)

From peeking at the SL schematic it looks like one of the "bank select" lines (which act as the upper address lines on the ROMs) is used as one of the chip selects on that dedicated socket for the Smartwatch chip. That definitely makes it look like it'd be possible for that socket to be "switched out" when a scan happens.

Derek: interesting, my reverse engineered design definitely works with SLclock so it’d be great if you could point to any code in the SLclock Utility that does this bank switch? I posted the decompiled code in the GitHub issue.

John: I'm not much of an assembly language programmer, but if this theory is in the ballpark and I'm interpreting the service manual correctly (which may be a stretch, the manual is pretty terrible) look for reads/writes to I/O port 0xFFEA before/after the part of the code that issues the magical unlock/communication sequences against the DS1215.

Long and short of it is I think one of the bits on that port selects whether it's ROMCS0 or ROMCS1 that gets activated when Exxxx is read. The manual is frankly awful so I can't tell you which bit. The port is read/write, I suspect it's pretty important that you save the state and set it back to what it was after you're done with the clock.

It sounds very plausible to me, what do you think?

upgradefever commented 2 years ago

Hi freitz85, I sure would love to see support for the Tandy 1000 SL machine and hope that you and dJOS1475 could find a way that works. Many thanks for your efforts!