Closed hackerb9 closed 2 years ago
Neat... Having it run on a K-85 would be really cool. Now if only we had a hardware version to verify on. Not in my collection (sadly).
Oh, not sure if this helps or not - K-85 Service Manual - Memory detail at 3-41
I think I have Kyotronic-85 support working and will issue a pull request after a bit more testing. These are just notes for anyone who follows in my footsteps:
It does appear that all the Kyotronic-85 sisters actually can be identified reasonably uniquely by looking at PEEK(1), which is an old technique (from the 1980s) that was used for differentiating between the Model 100 and similar machines.
Model | PEEK(1) | RAM Directory Address | SAVEM bug? | KB Count Address |
---|---|---|---|---|
Kyocera Kyotronic-85 | 225 | 63849 | Yes | 65387 |
TRS-80 Model 100 | 51 | 63842 | No | 65450 |
Tandy 102 | 167 | 63842 | No | 65450 |
Tandy 102 (UK) | 167 | 63842 | No | 65450 |
Tandy 200 | 171 | 62034 | No | 64799 |
NEC PC-8201 | 148 | 63567 | Yes | 65128 |
NEC PC-8201A | 148 | 63567 | Yes | 65128 |
NEC PC-8300 | 148 | 63567 | Yes | 65128 |
Olivetti M10 (Italy) | 35 | 63849 | Yes | 65389 |
Olivetti M10 (US) | 125 | ? | ? | ? |
For all machines, the Keyboard Buffer starts one byte after the Keyboard Buffer Count. The buffer holds 32 entries on all machines. Except on the M10, each entry takes two bytes. Only the second byte seems to be significant for ordinary keystrokes. On the M10, each entry takes a single byte.
All of the Kyotronic sisters , except the ones from Tandy Radio-Shack, have what I was calling the "BSAVE BUG". Of course, for non-NEC machines, it is actually a bug in SAVEM. It affects only CMPRSS.DO, which uses SAVEM to allocate memory in the RAM Directory for the compressed wordlists. The bug is that the program halts after a line which contains SAVEM. A solution is to put that line in a subroutine and then, from "Direct Mode", the user can type "RETURN" to continue the program. I have created a routine which will programmatically add any string to the keyboard buffer so that, as soon as the program stops, the machine will think the user has typed RETURNENTER. It works on any platform.
So, it's like the dev. team just forgot that someone could be using BSAVE/SAVEM in code vs through direct entry? Curious that it survived existing on both platforms. I'd assume that code review would have caught it on the conversion. Maybe it is expected behaviour for the time...
Nice workaround to solve it :)
I was looking into what was needed for the Kyotronic-85 to work. The main thing needed is the start address of the Ram Directory. PEEK(1) on a K-85 is 225, which is how we're IDing the machines in line 2016.
I compared the tokenized BASIC for the K-85 and it seems to be equivalent to what runs on the Model 100/102/200. That makes life easier because we may have one less file format to deal with.