rampa069 / ZX-ESPectrum

A ZX spectrum 48K/128K emulator running on ESP32 with bitluni ESP32 VGA Board (also in TTG VGA32)
153 stars 46 forks source link

Fixing keyboard for some games, also fixing the README.md #7

Closed dcrespo3d closed 4 years ago

dcrespo3d commented 4 years ago

Hello, I'm working on a fork of your great project. I will be adding support for Wiimote (I have one sitting on a drawer :)

I have made a small change in the code which handles keyboard input which I thing makes it more general. It handles all cases your code did, and a few more.

Most games read keyboard state using individual ports (FE/FD/FB/F7/EF/DF/BF/7F). But other games different approaches. For example, Manic Miner from Matthew Smith reads port 7E (which happens to be a combination of FE and 7F) for using any key in the bottom row for jumping. This code handles ALL cases.

Also, I have noticed that newer versions of Bitluni's ESP32Lib VGA driver won't work with this project (0.3.3 won't compile), so I think you should state it in your README.md. I have changed it for you.

Regards and congratulations on your excellent work. This is the project I would have done myself if you hadn't done it before, and saved me all the work :)

jorgefuertes commented 4 years ago

Thanks for your contrib, amigo David. Please give us a couple of hours to examine the changes.

jorgefuertes commented 4 years ago

If I'm understanding it well... It removes keyboard support to add wiimote input?

dcrespo3d commented 4 years ago

Hello,

If I'm understanding it well... It removes keyboard support to add wiimote input?

The PS/2 keyboard support removal is ONLY for my fork. Currently I don´t have access to a PS/2 Keyboard (maybe next week) so I haven´t been able to test it.

The change I am proposing is ONLY for file src/z80main.cpp, for fixing issues with some games such as manic miner which use a negated bit mask for reading the bottom keyboard row at once.

Also I wanted to include in your README.md that the ESP32Lib from bitluni doesn't work with your code using current version 0.3.3. I have been able to use version 0.2.1 which matches the time period (may 2019) you released your last version of your project.

I'm sorry, I'm a bit of a newbie in the matter of pull requests... I forked your repo, commited the src/z80main.cpp and README.md changes and then made the pull request. Later, I added my changes which remove keyboard support for adding wiimote input, but my intention is NOT for you to pull ALL those changes, JUST the keyboard port fix and the README.

When I have access to a PS2 Keyboard I would like to simultaneously support it AND the Wiimote, but i have to think about the logic of common access to the same resource (the 40 bits which represent the state of the spectrum keys) from both input devices (PS2 AND Wiimote), I don't like the idea of coding it blindly without testing. But that is a story for another day.

Sorry about the confusion...

Regards,

    David Crespo

jorgefuertes commented 4 years ago

Please, send a complete pull-request to wiimote branch, and a restricted one to master, with the keyboard and text files changes. Thanks a lot, David.

dcrespo3d commented 4 years ago

Ok, I'm working on it. Currently I can't have the do_keyboard function and the updateWiimote2Keys() simultaneously, because the do_keyboard function overwrites the values set by updateWiimote2Keys, give me half some time and I will try to fix it.