Gp2xpectrum 1.7.2 With Usb Keyboard Support!


Metalbrain

Still Fresh
Joined
Aug 8, 2006
Messages
78
Age
47
After some headaches, I finally managed to read the scancodes of USB keyboards and therefore add USB keyboard support to the emulator, so here it is a new version:

http://www.speccy.org/metalbrain/GP2Xpectrum1.7.2.zip

What's new:
- No +3 reset when loading a .dsk file if we're already using that model. This makes possible to play multi-disk games.
- Added USB keyboard support.

Thanks again to headoverheels for the optimized compilation.

The USB keyboard code itself is quite simple, but it took me a while to hit the correct key (pun intended). Special thanks to foft, as without his example code (here: http://www.gp32x.de/board/index.php?showtopic=40497 ), I wouldn't have known where to start.

Dedicated to ArChEr, who sent me a minicradle a long time ago so I could do it.
 
Last edited by a moderator:
Thanks Metalbrain!

Do you have any future enhancements for GP2xpectrum planned? The improvements are getting pretty specialised now.

I have never actually tried any Spectrum disk games, I mainly play 48k tape images. Can anyone recommend any good multi-disk games?
 
Thank you very much Metalbrain! This is one of the best GP2X Emulator ^_^
 
WhizzBang said:
Do you have any future enhancements for GP2xpectrum planned? The improvements are getting pretty specialised now.
Sorry, but no. Right now I'm with my hands full on CEZ GS, developing my own Spectrum game (and helping with others).

Rlyeh was going to add russian models support, but unfortunately he has retired.
 
Last edited by a moderator:
Metalbrain said:
WhizzBang said:
Do you have any future enhancements for GP2xpectrum planned? The improvements are getting pretty specialised now.
Sorry, but no. Right now I'm with my hands full on CEZ GS, developing my own Spectrum game (and helping with others).

Rlyeh was going to add russian models support, but unfortunately he has retired.


Are you going to port your excellent emu to pandora?
 
Last edited by a moderator:
Cool. Was wondering if anyone ever looked at or used any of that code. I only released it as a private version of Atari800 to one person. There must be an easier way though! Its all incredibly annoying because so much of it would be simpler with a more current version of Linux. I'll have to download your code to see what you did:)
 
Hirolaser said:
Are you going to port your excellent emu to pandora?
No, because I'm not planning to buy a Pandora (at least not yet, I'm still happy with my GP2X). But I'm sure someone will port it soon, I don't think it will be too difficult.

foft said:
Cool. Was wondering if anyone ever looked at or used any of that code. I only released it as a private version of Atari800 to one person. There must be an easier way though! Its all incredibly annoying because so much of it would be simpler with a more current version of Linux. I'll have to download your code to see what you did:)
I simplified all I could. First I dropped the loadkeys and unicode stuff, together with the joysticks and mouse support from the example and I got it working only with keyboard support showing the scancodes.

Then started translating the code from C++ to C, dropped the threads and managed to get the USB keyboard recognition following the same steps as your code (open /dev/input/ directory, look for event* filenames, open them and test if they are a keyboard using iotcl functions.

Reading the scancodes was a bit harder to get right. I didn't look at your code too much, but rather some linux docs. Just reading would block the program until a key was pressed, other methods such as using the O_NONBLOCK flags didn't help, and would read nothing or get garbare. Only in the end I realized that parameters for the select function had to be recreated before each call, and then it got easy, I made an array for the keyboard holding the state of each key, and then you just need a different table to map those keys to the emulated ones.

OTOH, Gnostic found another way to read the keyboard for Vice, and has posted his code here:
http://www.gp32x.de/board/index.php?showt...43255&st=75
 
Last edited by a moderator:
Metalbrain said:
Rlyeh was going to add russian models support, but unfortunately he has retired.
that's a pity. :( supporting TR-DOS disk system and Pentagon/Profi/ATM would be really cool, because there are tons of original software for this platform.
 
Last edited by a moderator:
Back
Top