I ported RAMDSK to Olivetti M-10

https://github.com/bkw777/NODE_DATAPAC/tree/main/software/RAMDSK/src

https://github.com/bkw777/NODE_DATAPAC/blob/main/ref/MiniNDP_M10_1.jpg
https://github.com/bkw777/NODE_DATAPAC/blob/main/ref/MiniNDP_M10_2.jpg
https://github.com/bkw777/NODE_DATAPAC/blob/main/ref/MiniNDP_M10_3.jpg
https://github.com/bkw777/NODE_DATAPAC/blob/main/ref/MiniNDP_M10_4.jpg

Ran into a small weird one.

When getting a single shared source to output for both 100 & 200, and then when adding K85, for all of those I just found all the equivalent addresses to the functions and variables in the system roms and everything worked the same on all 3 models.

I did the same for M10, and almost everything worked but just not the F1 key (bank switch). The key itself is fine since it works in TEXT & TELCOM.

The overall method of reading the F-keys must be right, since all the other F-keys worked. Just F1 didn't register at all. So ie it's not a case of needing to look at some other address to get the keyboard column scan bits.

In the end it was a difference in the behavior of the system rom KYREAD function just on Olivetti.

The main ReadKeyboard routine in RAMDSK calls KYREAD in the system rom (0x7242 in the 100 main rom - https://github.com/bkw777/m100_dev/blob/main/rom_cross_map.csv#L410)

On return from this, some value is in A for the keypress, Z flag means no keypress, C (carry) flag means it's a special key including the F-keys and others in the top row like Label.

For the F-keys, the value in A starts at 0 for F1. F1->A=0, F2->A=1, etc So if you press F1, A will be 0. Which is distinguished from no-keypress only by the Z and/or C flags.

Ken's and/or Covington's docs do document that you detect the special keys from this routine by the carry flag. But RAMDSK was not actually checking the carry immediately after return. It was first checking for Z, and if Z then that's no keypress -> loop and ReadKeyboard again.

That was working, not only on 100 & 200, but still worked on K85 too. So even though F1 -> A=0, it wasn't setting Z and so the RAMDSK code worked.

But Olivetti does set Z in that case. So everything in the app worked, including all the other F-keys and Label key, but just F1 was not registering at all.

I just had to insert a dedicated "JC ProcessSpecialKey" to catch the carry flag as the first thing after KYREAD before allowing the JZ to look at the Z flag. It's still correct this way for all the other machines too so it doesn't need an IFDEF just for M10.

But I was pretty mystified for a bit there.

As similar as all the roms are, there are a lot of weird little differences too besides simply having things moved around to different addresses or simply omitted like for the modem on international versions. There are routines that end up working alike, but are implemented a little differently inside.

--
bkw

Reply via email to