diff --git a/MCUME_pico/CMakeLists.txt b/MCUME_pico/CMakeLists.txt index d596bed..96539ee 100644 --- a/MCUME_pico/CMakeLists.txt +++ b/MCUME_pico/CMakeLists.txt @@ -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) diff --git a/MCUME_pico/bin/PICOMPUTERMAX/pico20.uf2 b/MCUME_pico/bin/PICOMPUTERMAX/pico20.uf2 index b2ef3f3..4100c0a 100644 Binary files a/MCUME_pico/bin/PICOMPUTERMAX/pico20.uf2 and b/MCUME_pico/bin/PICOMPUTERMAX/pico20.uf2 differ diff --git a/MCUME_pico/bin/PICOMPUTERMAX/pico64.uf2 b/MCUME_pico/bin/PICOMPUTERMAX/pico64.uf2 index b29cfed..5566161 100644 Binary files a/MCUME_pico/bin/PICOMPUTERMAX/pico64.uf2 and b/MCUME_pico/bin/PICOMPUTERMAX/pico64.uf2 differ diff --git a/MCUME_pico/bin/PICOMPUTERMAX/pico800.uf2 b/MCUME_pico/bin/PICOMPUTERMAX/pico800.uf2 index 75efcc0..92dbd8b 100644 Binary files a/MCUME_pico/bin/PICOMPUTERMAX/pico800.uf2 and b/MCUME_pico/bin/PICOMPUTERMAX/pico800.uf2 differ diff --git a/MCUME_pico/bin/PICOMPUTERMAX/pico81.uf2 b/MCUME_pico/bin/PICOMPUTERMAX/pico81.uf2 index e69d556..8df6d6f 100644 Binary files a/MCUME_pico/bin/PICOMPUTERMAX/pico81.uf2 and b/MCUME_pico/bin/PICOMPUTERMAX/pico81.uf2 differ diff --git a/MCUME_pico/bin/PICOMPUTERMAX/picocolem.uf2 b/MCUME_pico/bin/PICOMPUTERMAX/picocolem.uf2 index bdd9568..bd0f580 100644 Binary files a/MCUME_pico/bin/PICOMPUTERMAX/picocolem.uf2 and b/MCUME_pico/bin/PICOMPUTERMAX/picocolem.uf2 differ diff --git a/MCUME_pico/bin/PICOMPUTERMAX/picoo2em.uf2 b/MCUME_pico/bin/PICOMPUTERMAX/picoo2em.uf2 index b45adbe..c0902e4 100644 Binary files a/MCUME_pico/bin/PICOMPUTERMAX/picoo2em.uf2 and b/MCUME_pico/bin/PICOMPUTERMAX/picoo2em.uf2 differ diff --git a/MCUME_pico/bin/PICOMPUTERMAX/picospeccy.uf2 b/MCUME_pico/bin/PICOMPUTERMAX/picospeccy.uf2 index 2d0210e..065038b 100644 Binary files a/MCUME_pico/bin/PICOMPUTERMAX/picospeccy.uf2 and b/MCUME_pico/bin/PICOMPUTERMAX/picospeccy.uf2 differ diff --git a/MCUME_pico/bin/PICOMPUTERMAX/picovcs.uf2 b/MCUME_pico/bin/PICOMPUTERMAX/picovcs.uf2 index c332f9a..002ba20 100644 Binary files a/MCUME_pico/bin/PICOMPUTERMAX/picovcs.uf2 and b/MCUME_pico/bin/PICOMPUTERMAX/picovcs.uf2 differ diff --git a/MCUME_pico/bin/PICOMPUTERMAX/testkeymax.uf2 b/MCUME_pico/bin/PICOMPUTERMAX/testkeymax.uf2 index 8919b79..3a4576e 100644 Binary files a/MCUME_pico/bin/PICOMPUTERMAX/testkeymax.uf2 and b/MCUME_pico/bin/PICOMPUTERMAX/testkeymax.uf2 differ diff --git a/MCUME_pico/bin/PICORETROVGA/pico20.uf2 b/MCUME_pico/bin/PICORETROVGA/pico20.uf2 index f8facc5..143fdde 100644 Binary files a/MCUME_pico/bin/PICORETROVGA/pico20.uf2 and b/MCUME_pico/bin/PICORETROVGA/pico20.uf2 differ diff --git a/MCUME_pico/bin/PICORETROVGA/pico64.uf2 b/MCUME_pico/bin/PICORETROVGA/pico64.uf2 index fc28e9f..f881289 100644 Binary files a/MCUME_pico/bin/PICORETROVGA/pico64.uf2 and b/MCUME_pico/bin/PICORETROVGA/pico64.uf2 differ diff --git a/MCUME_pico/bin/PICORETROVGA/pico800.uf2 b/MCUME_pico/bin/PICORETROVGA/pico800.uf2 index 3d720e1..9c8eee1 100644 Binary files a/MCUME_pico/bin/PICORETROVGA/pico800.uf2 and b/MCUME_pico/bin/PICORETROVGA/pico800.uf2 differ diff --git a/MCUME_pico/bin/PICORETROVGA/pico81.uf2 b/MCUME_pico/bin/PICORETROVGA/pico81.uf2 index 0ad1e11..66fe33c 100644 Binary files a/MCUME_pico/bin/PICORETROVGA/pico81.uf2 and b/MCUME_pico/bin/PICORETROVGA/pico81.uf2 differ diff --git a/MCUME_pico/bin/PICORETROVGA/picocolem.uf2 b/MCUME_pico/bin/PICORETROVGA/picocolem.uf2 index 248231c..2b71c80 100644 Binary files a/MCUME_pico/bin/PICORETROVGA/picocolem.uf2 and b/MCUME_pico/bin/PICORETROVGA/picocolem.uf2 differ diff --git a/MCUME_pico/bin/PICORETROVGA/picoo2em.uf2 b/MCUME_pico/bin/PICORETROVGA/picoo2em.uf2 index ebb2714..74e70ee 100644 Binary files a/MCUME_pico/bin/PICORETROVGA/picoo2em.uf2 and b/MCUME_pico/bin/PICORETROVGA/picoo2em.uf2 differ diff --git a/MCUME_pico/bin/PICORETROVGA/picospeccy.uf2 b/MCUME_pico/bin/PICORETROVGA/picospeccy.uf2 index 00614de..9d30791 100644 Binary files a/MCUME_pico/bin/PICORETROVGA/picospeccy.uf2 and b/MCUME_pico/bin/PICORETROVGA/picospeccy.uf2 differ diff --git a/MCUME_pico/bin/PICORETROVGA/picovcs.uf2 b/MCUME_pico/bin/PICORETROVGA/picovcs.uf2 index 2e42139..2cefd05 100644 Binary files a/MCUME_pico/bin/PICORETROVGA/picovcs.uf2 and b/MCUME_pico/bin/PICORETROVGA/picovcs.uf2 differ diff --git a/MCUME_pico/bin/PICORETROVGA/testkeymax.uf2 b/MCUME_pico/bin/PICORETROVGA/testkeymax.uf2 index 214993a..a116535 100644 Binary files a/MCUME_pico/bin/PICORETROVGA/testkeymax.uf2 and b/MCUME_pico/bin/PICORETROVGA/testkeymax.uf2 differ diff --git a/MCUME_pico/bin/PICOZX/pico20.uf2 b/MCUME_pico/bin/PICOZX/pico20.uf2 index 7fc9594..0e01a7a 100644 Binary files a/MCUME_pico/bin/PICOZX/pico20.uf2 and b/MCUME_pico/bin/PICOZX/pico20.uf2 differ diff --git a/MCUME_pico/bin/PICOZX/pico64.uf2 b/MCUME_pico/bin/PICOZX/pico64.uf2 index a384033..894d0ab 100644 Binary files a/MCUME_pico/bin/PICOZX/pico64.uf2 and b/MCUME_pico/bin/PICOZX/pico64.uf2 differ diff --git a/MCUME_pico/bin/PICOZX/pico800.uf2 b/MCUME_pico/bin/PICOZX/pico800.uf2 index fea9e2e..e2513b0 100644 Binary files a/MCUME_pico/bin/PICOZX/pico800.uf2 and b/MCUME_pico/bin/PICOZX/pico800.uf2 differ diff --git a/MCUME_pico/bin/PICOZX/pico81.uf2 b/MCUME_pico/bin/PICOZX/pico81.uf2 index 07ed611..0f6c687 100644 Binary files a/MCUME_pico/bin/PICOZX/pico81.uf2 and b/MCUME_pico/bin/PICOZX/pico81.uf2 differ diff --git a/MCUME_pico/bin/PICOZX/picocolem.uf2 b/MCUME_pico/bin/PICOZX/picocolem.uf2 index 908c078..eabfe42 100644 Binary files a/MCUME_pico/bin/PICOZX/picocolem.uf2 and b/MCUME_pico/bin/PICOZX/picocolem.uf2 differ diff --git a/MCUME_pico/bin/PICOZX/picoo2em.uf2 b/MCUME_pico/bin/PICOZX/picoo2em.uf2 index f3eb0b8..48399e1 100644 Binary files a/MCUME_pico/bin/PICOZX/picoo2em.uf2 and b/MCUME_pico/bin/PICOZX/picoo2em.uf2 differ diff --git a/MCUME_pico/bin/PICOZX/picospeccy.uf2 b/MCUME_pico/bin/PICOZX/picospeccy.uf2 index de8628f..f92a594 100644 Binary files a/MCUME_pico/bin/PICOZX/picospeccy.uf2 and b/MCUME_pico/bin/PICOZX/picospeccy.uf2 differ diff --git a/MCUME_pico/bin/PICOZX/picovcs.uf2 b/MCUME_pico/bin/PICOZX/picovcs.uf2 index 34bc31f..d425001 100644 Binary files a/MCUME_pico/bin/PICOZX/picovcs.uf2 and b/MCUME_pico/bin/PICOZX/picovcs.uf2 differ diff --git a/MCUME_pico/bin/PICOZX/testkeymax.uf2 b/MCUME_pico/bin/PICOZX/testkeymax.uf2 index 4946d53..586f9b2 100644 Binary files a/MCUME_pico/bin/PICOZX/testkeymax.uf2 and b/MCUME_pico/bin/PICOZX/testkeymax.uf2 differ diff --git a/MCUME_pico/display/emuapi.cpp b/MCUME_pico/display/emuapi.cpp index 9bfe30e..e76ff0a 100644 --- a/MCUME_pico/display/emuapi.cpp +++ b/MCUME_pico/display/emuapi.cpp @@ -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',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[] = { diff --git a/MCUME_pico/pico20/v20.cpp b/MCUME_pico/pico20/v20.cpp index 649e53c..64d510b 100644 --- a/MCUME_pico/pico20/v20.cpp +++ b/MCUME_pico/pico20/v20.cpp @@ -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) ) { diff --git a/MCUME_pico/pico64/emucfg.h b/MCUME_pico/pico64/emucfg.h index 8190ce5..752cc16 100644 --- a/MCUME_pico/pico64/emucfg.h +++ b/MCUME_pico/pico64/emucfg.h @@ -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[] = { diff --git a/MCUME_pico/pico800/emucfg.h b/MCUME_pico/pico800/emucfg.h index b372d8c..8391946 100644 --- a/MCUME_pico/pico800/emucfg.h +++ b/MCUME_pico/pico800/emucfg.h @@ -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 };