add cursor keys to at800,c64,v20

master
jean-marcharvengt 2023-04-22 18:04:03 +02:00
rodzic f8d5087360
commit 8eec4cf375
33 zmienionych plików z 25 dodań i 27 usunięć

Wyświetl plik

@ -6,9 +6,9 @@ include(pico_sdk_import.cmake)
# We also need PICO EXTRAS
#include(pico_extras_import.cmake)
#set(TARGET testkeymax)
set(TARGET testkeymax)
#set(TARGET pico20)
set(TARGET pico64)
#set(TARGET pico64)
#set(TARGET pico81)
#set(TARGET picospeccy)
#set(TARGET pico800)

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -491,6 +491,7 @@ int emu_ReadKeys(void)
if ( !gpio_get(PIN_KEY_USER4) ) retval |= MASK_KEY_USER4;
#endif
#if (defined(PICOMPUTER) || defined(PICOZX) )
keymatrix_hitrow = -1;
unsigned char row;
@ -539,8 +540,6 @@ int emu_ReadKeys(void)
keymatrixtmp[i] = row;
}
#ifdef SWAP_ALT_DEL
// Swap ALT and DEL
unsigned char alt = keymatrixtmp[0] & 0x02;
@ -564,15 +563,17 @@ int emu_ReadKeys(void)
keymatrix[i] = row;
}
#ifdef PICOZX
key_fn = false;
key_alt = false;
//row = keymatrix[6];
if ( row & 0x02 ) retval |= MASK_KEY_USER1;
if ( row & 0x10 ) retval |= MASK_KEY_USER2;
if ( row & 0x20 ) retval |= MASK_KEY_USER3;
if ( row & 0x40 ) retval |= MASK_KEY_USER4;
row = keymatrix[0];
key_fn = false;
key_alt = false;
if ( row & 0x20 ) {key_fn = true; keymatrix[0] &= ~0x20;}
if ( row & 0x40 ) {key_alt = true;keymatrix[0] &= ~0x40; }
//19,20,21,22,26,27,28
#if INVX
if ( row & 0x2 ) retval |= MASK_JOY2_LEFT;
@ -589,10 +590,8 @@ int emu_ReadKeys(void)
if ( row & 0x8 ) retval |= MASK_JOY2_UP;
#endif
if ( row & 0x04 ) retval |= MASK_JOY2_BTN;
if ( row & 0x20 ) key_fn = true;
if ( row & 0x40 ) key_alt = true;
#else
#else // end PICOZX
//6,9,15,8,7,22
#if INVX
if ( row & 0x2 ) retval |= MASK_JOY2_LEFT;
@ -690,11 +689,10 @@ int emu_ReadKeys(void)
gpio_put(KLED, 0);
}
}
#endif
#endif
if ( key_fn ) retval |= MASK_KEY_USER2;
if ( ( key_fn ) && (keymatrix[0] == 0x02 )) retval |= MASK_KEY_USER1;
#endif
#endif
@ -739,7 +737,7 @@ int emu_ReadI2CKeyboard(void) {
unsigned short match = ((unsigned short)keymatrix_hitrow<<8) | keymatrix[keymatrix_hitrow];
for (int i=0; i<sizeof(matkeys)/sizeof(unsigned short); i++) {
if (match == matkeys[i]) {
hundred_ms_cnt = 0;
hundred_ms_cnt = 0;
return (keys[i]);
}
}

Wyświetl plik

@ -34,7 +34,7 @@ const unsigned short key_map2[] = {
0,0,0,'<','>',0,0,0,';','"',
0,0,0,0,0,'^','-','+','=',0x0D,
0,':',0,'?','\/','*',',','.',0,' ',
145,157,29,17,0,0 // U L R D
145,157,29,17,157,29 // U L R D L R
};
const unsigned short key_map3[] = {
@ -42,7 +42,7 @@ const unsigned short key_map3[] = {
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0
145,157,29,17,157,29 // U L R D L R
};
const unsigned short matkeys[] = {

Wyświetl plik

@ -201,13 +201,12 @@ const uint32_t ascii2scan[] = {
static int ik;
static int ihk;
static int pik=0;
void v20_Input(int bClick) {
ik = emu_GetPad();
ihk = emu_ReadI2CKeyboard();
ik = emu_GetPad();
}
void emu_KeyboardOnDown(int keymodifer, int key) {
@ -360,7 +359,7 @@ void v20_Step(void)
#if (defined(PICOMPUTER) || defined(PICOZX) )
if (hk) {
int scan = ascii2scan[ihk];
int scan = ascii2scan[hk];
if (scan & 0x10000) mos6522.setShiftPressed(true);
else mos6522.setShiftPressed(false);
mos6522.setKeyPressed(scan & 0xffff);
@ -375,7 +374,8 @@ void v20_Step(void)
int k=ik;
#if (defined(PICOMPUTER) || defined(PICOZX) )
// Ignore joypad if shift is pressed!!!
if ( !(k & MASK_KEY_USER2) )
// if ( !(k & MASK_KEY_USER2) )
if ( hk == 0 )
#endif
{
if ( !(pik & MASK_JOY2_BTN) && (k & MASK_JOY2_BTN) ) {

Wyświetl plik

@ -26,7 +26,7 @@ const unsigned short key_map1[] = {
'Q','W','E','R','T','Y','U','I','O','P',
'A','S','D','F','G','H','J','K','L',0x0D,
0,'Z','X','C','V','B','N','M',0,' ',
0,0,0,0,157,29 // L R
0,0,0,0,157,29 // L R
};
const unsigned short key_map2[] = {
@ -42,7 +42,7 @@ const unsigned short key_map3[] = {
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0
145,157,29,17,0,0 // U L R D
};
const unsigned short matkeys[] = {

Wyświetl plik

@ -27,7 +27,7 @@ const unsigned short key_map1[] = {
0x2F+1,0x2F,0x2A+1,0x28+1,0x2D+1,0x2B+1,0x0B+1,0x0D+1,0x08+1,0x0A+1,
0x3F+1,0x3F,0x3A+1,0x38+1,0x3D+1,0x39+1,0x01+1,0x05+1,0x00+1,0x0D,
0,0x17+1,0x16+1,0x12+1,0x10+1,0x15+1,0x23+1,0x25+1,0,0x21+1,
0,0,0,0,0,0 //U L R D L R
0,0,0,0,0x34+1,0x87+1 // back R
};
const unsigned short key_map2[] = {
@ -35,7 +35,7 @@ const unsigned short key_map2[] = {
0,0,0,0x36+1,0x37+1,0,0,0,0x02+1,94+1,
0,0,0,0,0,0,0x0E + 1,0x06+1,0x0F+1,0x0D,
0,66+1,0,102+1,0x26+1,0x07+1,0x20+1,0x22+1,0,' ',
0,0,0,0,0,0
0x8e + 1,0x86+1,0x87+1,0x8f+1,0x34+1,0x87+1 //U L R D back R
};
const unsigned short key_map3[] = {
@ -43,7 +43,7 @@ const unsigned short key_map3[] = {
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0
0x8e + 1,0x86+1,0x87+1,0x8f+1,0x34+1,0x87+1 //U L R D back R
};
const unsigned short matkeys[] = {
@ -72,7 +72,7 @@ const unsigned short key_map2[] = {
0x1F+1,0x1F,0x1A+1,0x18+1,0x1D+1,0x1B+1,0x33+1,0x35+1,0x30+1,0x32+1,0x0F+1, // Digits
0x2C+1,95+1,117+1,90+1,88+1,93+1,0x06+1,91+1,0x07+1,0x0E + 1,0, // various
0, 112+1,114+1,102+1,0x26+1,94+1,0x36+1,0x37+1,0x20+1,66+1,
0,0,0,0
0x8e + 1,0x86+1,0x87+1,0x8f+1 //U L R D
};
//0x07+1=*, 0x22+1=.,0x26+1=/, 0x02+1=;, 0x06+1=+, 0x36+1=<, 0x37+1=>, 0x0F+1==, 0x0E+1=-, 0x06+1=+
@ -83,7 +83,7 @@ const unsigned short key_map3[] = {
3+1,4+1,19+1,20+1,17+1,0,0,0,0,0,0, // function keys
0, 0,0,0,0,0,0,0,0,0,0,
0, 0,0,0,0,115+1,0,0,0x02+1,0,
0,0,0,0
0x8e + 1,0x86+1,0x87+1,0x8f+1 //U L R D
};