Updated CompuMate keyboard handler to be more friendly,

and use keys on a real keyboard more effectively.

Bumped version number, so we start all over again.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2426 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2012-03-18 01:40:27 +00:00
parent 68f5c9e57b
commit ea74f6dbe3
4 changed files with 73 additions and 9 deletions

View File

@ -12,6 +12,15 @@
Release History
===========================================================================
3.6 to 3.7: (April xx, 2012)
* Updated the CompuMate keyboard handler to recognize more keys on an
actual keyboard, instead of having to remember the weird combinations
used on the original CompuMate keyboard.
-Have fun!
3.5.5 to 3.6: (March 16, 2012)
* Added support for 2600-daptor II device, including native support
@ -40,8 +49,6 @@
* Updated included PNG library to latest stable version.
-Have fun!
3.5 to 3.5.5: (February 4, 2012)

View File

@ -1277,9 +1277,20 @@
<tr><td>Period </td><td>Period </td></tr>
<tr><td>Func </td><td>Control (left or right) </td></tr>
<tr><td>Shift </td><td>Shift (left or right) </td></tr>
<tr><td>Enter </td><td>; or Return/Enter </td></tr>
<tr><td>Space </td><td>/ or Space </td></tr>
<tr><td>Enter </td><td>Return/Enter </td></tr>
<tr><td>Space </td><td>Space </td></tr>
<tr><td>Func-Space </td><td>Backspace </td></tr>
<tr><td>+ </td><td>+ or Shift-1 </td></tr>
<tr><td>- </td><td>- or Shift-2</td></tr>
<tr><td>* </td><td>Shift-3 </td></tr>
<tr><td>/ </td><td>/ or Shift-4 </td></tr>
<tr><td>= </td><td>= or Shift-5 </td></tr>
<tr><td>? </td><td>? (Shift-/) or Shift-6 </td></tr>
<tr><td>$ </td><td>Shift-7 </td></tr>
<tr><td>[ </td><td>[ or Shift-8 </td></tr>
<tr><td>] </td><td>] or Shift-9 </td></tr>
<tr><td>&quot; </td><td>" (Shift-') or Shift-0 </td></tr>
</table>
<a name="DeveloperKeys"></a>

View File

@ -22,7 +22,7 @@
#include <cstdlib>
#define STELLA_VERSION "3.6"
#define STELLA_VERSION "3.7_svn"
#define STELLA_BUILD atoi("$Rev$" + 6)
#endif

View File

@ -83,18 +83,36 @@ void CompuMate::update()
break;
case 1:
if (KeyTable[KBDK_6]) lp.myDigitalPinState[Controller::Six] = false;
// Emulate the '?' character (Shift-6) with the actual question key
if (KeyTable[KBDK_SLASH] && (KeyTable[KBDK_LSHIFT] || KeyTable[KBDK_RSHIFT]))
{
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (KeyTable[KBDK_y]) rp.myDigitalPinState[Controller::Three] = false;
if (KeyTable[KBDK_h]) rp.myDigitalPinState[Controller::Six] = false;
if (KeyTable[KBDK_n]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 2:
if (KeyTable[KBDK_8]) lp.myDigitalPinState[Controller::Six] = false;
// Emulate the '[' character (Shift-8) with the actual key
if (KeyTable[KBDK_LEFTBRACKET] && !(KeyTable[KBDK_LSHIFT] || KeyTable[KBDK_RSHIFT]))
{
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (KeyTable[KBDK_i]) rp.myDigitalPinState[Controller::Three] = false;
if (KeyTable[KBDK_k]) rp.myDigitalPinState[Controller::Six] = false;
if (KeyTable[KBDK_COMMA]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 3:
if (KeyTable[KBDK_2]) lp.myDigitalPinState[Controller::Six] = false;
// Emulate the '-' character (Shift-2) with the actual minus key
if (KeyTable[KBDK_MINUS] && !(KeyTable[KBDK_LSHIFT] || KeyTable[KBDK_RSHIFT]))
{
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (KeyTable[KBDK_w]) rp.myDigitalPinState[Controller::Three] = false;
if (KeyTable[KBDK_s]) rp.myDigitalPinState[Controller::Six] = false;
if (KeyTable[KBDK_x]) rp.myDigitalPinState[Controller::Four] = false;
@ -107,11 +125,15 @@ void CompuMate::update()
break;
case 5:
if (KeyTable[KBDK_0]) lp.myDigitalPinState[Controller::Six] = false;
// Emulate the quote character (Shift-0) with the actual quote key
if (KeyTable[KBDK_QUOTE] && (KeyTable[KBDK_LSHIFT] || KeyTable[KBDK_RSHIFT]))
{
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (KeyTable[KBDK_p]) rp.myDigitalPinState[Controller::Three] = false;
if (KeyTable[KBDK_SEMICOLON] || KeyTable[KBDK_RETURN])
rp.myDigitalPinState[Controller::Six] = false;
if (KeyTable[KBDK_SLASH] || KeyTable[KBDK_SPACE])
rp.myDigitalPinState[Controller::Four] = false;
if (KeyTable[KBDK_RETURN]) rp.myDigitalPinState[Controller::Six] = false;
if (KeyTable[KBDK_SPACE]) rp.myDigitalPinState[Controller::Four] = false;
// Emulate Ctrl-space (aka backspace) with the actual Backspace key
if (KeyTable[KBDK_BACKSPACE])
{
@ -121,24 +143,48 @@ void CompuMate::update()
break;
case 6:
if (KeyTable[KBDK_9]) lp.myDigitalPinState[Controller::Six] = false;
// Emulate the ']' character (Shift-9) with the actual key
if (KeyTable[KBDK_RIGHTBRACKET] && !(KeyTable[KBDK_LSHIFT] || KeyTable[KBDK_RSHIFT]))
{
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (KeyTable[KBDK_o]) rp.myDigitalPinState[Controller::Three] = false;
if (KeyTable[KBDK_l]) rp.myDigitalPinState[Controller::Six] = false;
if (KeyTable[KBDK_PERIOD]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 7:
if (KeyTable[KBDK_5]) lp.myDigitalPinState[Controller::Six] = false;
// Emulate the '=' character (Shift-5) with the actual equals key
if (KeyTable[KBDK_EQUALS] && !(KeyTable[KBDK_LSHIFT] || KeyTable[KBDK_RSHIFT]))
{
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (KeyTable[KBDK_t]) rp.myDigitalPinState[Controller::Three] = false;
if (KeyTable[KBDK_g]) rp.myDigitalPinState[Controller::Six] = false;
if (KeyTable[KBDK_b]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 8:
if (KeyTable[KBDK_1]) lp.myDigitalPinState[Controller::Six] = false;
// Emulate the '+' character (Shift-1) with the actual plus key (Shift-=)
if (KeyTable[KBDK_EQUALS] && (KeyTable[KBDK_LSHIFT] || KeyTable[KBDK_RSHIFT]))
{
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (KeyTable[KBDK_q]) rp.myDigitalPinState[Controller::Three] = false;
if (KeyTable[KBDK_a]) rp.myDigitalPinState[Controller::Six] = false;
if (KeyTable[KBDK_z]) rp.myDigitalPinState[Controller::Four] = false;
break;
case 9:
if (KeyTable[KBDK_4]) lp.myDigitalPinState[Controller::Six] = false;
// Emulate the '/' character (Shift-4) with the actual slash key
if (KeyTable[KBDK_SLASH] && !(KeyTable[KBDK_LSHIFT] || KeyTable[KBDK_RSHIFT]))
{
rp.myAnalogPinValue[Controller::Five] = Controller::minimumResistance;
lp.myDigitalPinState[Controller::Six] = false;
}
if (KeyTable[KBDK_r]) rp.myDigitalPinState[Controller::Three] = false;
if (KeyTable[KBDK_f]) rp.myDigitalPinState[Controller::Six] = false;
if (KeyTable[KBDK_v]) rp.myDigitalPinState[Controller::Four] = false;