Recreated ZX Spectrum

For experts to discuss very technical stuff and newbies to ask why the Spectrum they bought off ebay doesn't work.
Post Reply
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: Recreated ZX Spectrum

Post by Einar Saukas »

This keyboard can report key presses only. It cannot report key releases. Therefore in normal "QWERTY Mode", a game would know when you pressed a key to go down, but it wouldn't know when you stopped pressing it.

The other "Game Mode" is a hack. For instance, whenever you press key "Z", the keyboard will report that "<" was pressed. And whenever you release key "Z", the keyboard will report that ">" was pressed. For each key in the keyboard, there's a corresponding pair of key codes to indicate when the actual key is pressed and when it's released.
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: Recreated ZX Spectrum

Post by dfzx »

Einar Saukas wrote: Tue Nov 21, 2017 1:28 pm This keyboard can report key presses only. It cannot report key releases. Therefore in normal "QWERTY Mode", a game would know when you pressed a key to go down, but it wouldn't know when you stopped pressing it.

The other "Game Mode" is a hack. For instance, whenever you press key "Z", the keyboard will report that "<" was pressed. And whenever you release key "Z", the keyboard will report that ">" was pressed. For each key in the keyboard, there's a corresponding pair of key codes to indicate when the actual key is pressed and when it's released.
I think "hack" is a bit strong. The keyboard generates coded "events", 40 of them to indicate a key going down, and 40 more indicating a key going up. That's always struck me as a perfectly good way for the keyboard to interact with its host. It certainly works, anyway. :)
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
User avatar
Einar Saukas
Bugaboo
Posts: 3070
Joined: Wed Nov 15, 2017 2:48 pm

Re: Recreated ZX Spectrum

Post by Einar Saukas »

If you press "1", the keyboard will say you pressed "A".

If you press "A", the keyboard will say you pressed "O".

If you press "Z", it will say you pressed "<".

It works, but it's a hack! :)
dfzx
Manic Miner
Posts: 673
Joined: Mon Nov 13, 2017 6:55 pm
Location: New Forest, UK
Contact:

Re: Recreated ZX Spectrum

Post by dfzx »

Einar Saukas wrote: Tue Nov 21, 2017 2:24 pm If you press "1", the keyboard will say you pressed "A".

If you press "A", the keyboard will say you pressed "O".

If you press "Z", it will say you pressed "<".

It works, but it's a hack! :)
If you press "1", the keyboard will generate an event with an encoded 0x41 value... Admittedly it's a keyboard, so the only thing it knows how to "say" is "you pressed..." but that's an overly literal interpretation of the device's communication.

Maybe it's just my UNIX level view of things. In UNIX, as I'm sure you know, everything is either a file or a process. What's coming into the device file which is attached to the USB device is an encoding. I have a USB footpedal device which generates similar events. If you say "it's a keyboard" then yes, I suppose it's saying "you pressed...". My footpedal is therefore a keyboard with 3 keys, none of which are rubber. :)
Derek Fountain, author of the ZX Spectrum C Programmer's Getting Started Guide and various open source games, hardware and other projects, including an IF1 and ZX Microdrive emulator.
Wall_Axe
Manic Miner
Posts: 492
Joined: Mon Nov 13, 2017 11:13 pm

Re: Recreated ZX Spectrum

Post by Wall_Axe »

the only way to authentically play Manic Miner is with rubber keys
User avatar
Spud
Manic Miner
Posts: 372
Joined: Sun Nov 12, 2017 8:50 pm
Contact:

Re: Recreated ZX Spectrum

Post by Spud »

Spud wrote: Tue Nov 21, 2017 12:59 pm That's my evening sorted tonight: I'll give it a proper test and try things like BEEP, etc, and also make sure I can do a ". I could be making things up (I hope I am not :oops: )
What a berk!

I can confirm that with querty mode I can neither get a " character, or toggle extend mode.

In Fuse, using speccy mode I can do both.

I think I must have tested the " character in some other application such as Sim Coupé before as it can produce one using symbol shift and 2. That doesn't work in the proper speccy emulators I tested (specemu, zxspin & spectaculator).
Post Reply