@J.F
did u update the hama driver also , or should i send fanjita the updated non blocking code .
anyway i got the prx code also working, but pikey only works partially that i can use the keyboard to browse the xmb but when i try to go to the game menu the psp freezes completely and most of the xmb funktion dont work .
BTW i 'm on 3.03 0e-c,
generic PSP IR Keyboard library now in SVN
This is the latest code in SVN:
http://svn.pspdev.org/diff.php?repname= ... =2211&sc=1
I think the non-blocking stuff is already in there for PalmUW and hama.
http://svn.pspdev.org/diff.php?repname= ... =2211&sc=1
I think the non-blocking stuff is already in there for PalmUW and hama.
No, just the palm driver. He was working on problems with pikey on newer OE firmwares, so you might just want to send him the driver code and wait for a newer update and try again.tyranos wrote:@J.F
did u update the hama driver also , or should i send fanjita the updated non blocking code .
anyway i got the prx code also working, but pikey only works partially that i can use the keyboard to browse the xmb but when i try to go to the game menu the psp freezes completely and most of the xmb funktion dont work .
BTW i 'm on 3.03 0e-c,
-
- Posts: 3
- Joined: Wed Jul 04, 2007 12:29 pm
Apps(with Irda Keyboard Support) crashes with some KBs confs
Hi Fanjita and Montsi!
First of all, i want to congratulate you for rocking, supporting and encouraging the PSP Scene.
Now the motivation for this msg is that i've tried to load the PSPoste(with Irda kb support) changing the parameter of the keyboard and i've obtained these results:
# 1 - Compaq/HP foldable keyboard - APP CRASH!
# 2 - Snap'n'Type - APP CRASH!
# 5 - HP Slim keyboard - APP CRASH!
# 8 - Belkin IR (not IrDA) - APP Loads OK
# 9 - Flexis FX-100 keyboard - APP Loads OK
# 10 - Benq G250 gamepad - APP CRASH!
# 12 - Micro Innovations Foldaway keyboard - APP LoadsOK
# 13 - Micro Innovations Datapad - APP Loads OK
# 14 - Compaq MicroKeyboard - APP CRASH!
# 15 - Targus Universal Wireless keyboard - APP Loads OK
# 18 - Freedom keyboard - APP Loads OK
# 19 - NOVAETS - KIS2 - IR Keyboard - APP Loads OK
# 20 - Palm Universal Wireless Keyboard - APP CRASH!
# 21 - Hama Palm IR keyboard - APP CRASH!
Besides, i've a snapNtype IR keyboard and when i change in the .ini file the 'keyboard' value to number "2" and try to run the PSP-PDA(with irda kb support) it crashed, with a BSOD and address values ended by this line:
"The offending routine may be identified with:
psp-addr2line -e target.elf -f -C 0x8a10138 0xbe540024 0x8a10290"
Any ideas? It's very extrange... there's no obvious reason for these errors. But it happens with all the apps of ZX-81 that i've tried. That makes me think that it's caused by the lib or by the way that ZX-81 use the lib.
I've been checking the code of the lib with no success. I've 3.4 OE FW in my PSP... i'm thinking that probably fanjita or monsti will know what is the problem with the lib or the use of it.
Thanks in advance for all your help and ideas.
First of all, i want to congratulate you for rocking, supporting and encouraging the PSP Scene.
Now the motivation for this msg is that i've tried to load the PSPoste(with Irda kb support) changing the parameter of the keyboard and i've obtained these results:
# 1 - Compaq/HP foldable keyboard - APP CRASH!
# 2 - Snap'n'Type - APP CRASH!
# 5 - HP Slim keyboard - APP CRASH!
# 8 - Belkin IR (not IrDA) - APP Loads OK
# 9 - Flexis FX-100 keyboard - APP Loads OK
# 10 - Benq G250 gamepad - APP CRASH!
# 12 - Micro Innovations Foldaway keyboard - APP LoadsOK
# 13 - Micro Innovations Datapad - APP Loads OK
# 14 - Compaq MicroKeyboard - APP CRASH!
# 15 - Targus Universal Wireless keyboard - APP Loads OK
# 18 - Freedom keyboard - APP Loads OK
# 19 - NOVAETS - KIS2 - IR Keyboard - APP Loads OK
# 20 - Palm Universal Wireless Keyboard - APP CRASH!
# 21 - Hama Palm IR keyboard - APP CRASH!
Besides, i've a snapNtype IR keyboard and when i change in the .ini file the 'keyboard' value to number "2" and try to run the PSP-PDA(with irda kb support) it crashed, with a BSOD and address values ended by this line:
"The offending routine may be identified with:
psp-addr2line -e target.elf -f -C 0x8a10138 0xbe540024 0x8a10290"
Any ideas? It's very extrange... there's no obvious reason for these errors. But it happens with all the apps of ZX-81 that i've tried. That makes me think that it's caused by the lib or by the way that ZX-81 use the lib.
I've been checking the code of the lib with no success. I've 3.4 OE FW in my PSP... i'm thinking that probably fanjita or monsti will know what is the problem with the lib or the use of it.
Thanks in advance for all your help and ideas.
-
- Posts: 3
- Joined: Wed Jul 04, 2007 12:29 pm
piKey with Snap'n'Type
Ok, i've reading Fanjita and then i've decide to install pikey, it's activated in the recovery menu, and i've also modified the ini file with the keyboard = 2.
But when i've push the keys there is only noise... i don't know what is wrong... any ideas? i think that everything indicate some bug in the pspirkeyb lib... what do you think Fanjita?
Probably pikey is the best way for support keyboards on our psp, i will be very happy if someday i can use my snapNtype in my psp :D :D :D
Regards,
saintshark
But when i've push the keys there is only noise... i don't know what is wrong... any ideas? i think that everything indicate some bug in the pspirkeyb lib... what do you think Fanjita?
Probably pikey is the best way for support keyboards on our psp, i will be very happy if someday i can use my snapNtype in my psp :D :D :D
Regards,
saintshark
-
- Posts: 3
- Joined: Wed Jul 04, 2007 12:29 pm
Reading Keys from a Snap'N'Type
Well like i can't achieve to modify correctly pikey, i'll contribute to the comunity with the scancodes, and the modification of a test of concept i've found in internet and complete with the scancodes of the snapNtype:
Does somebody know how to modify piKey to include a working support for this keyboard? Me and all the keyboard owners of a snapNtype will be very pleased. Thank you in advance. :)
saintshark
Code: Select all
/*
* PSP Software Development Kit - http://www.pspdev.org
* -----------------------------------------------------------------------
* Licensed under the BSD license, see LICENSE in PSPSDK root for details.
*
* main.c - IrDA Type - Modified by saintshark for Display text typed on a SnapNtype T806 PDA keyboard.
*
*
* Based on the work of Frank Buss <[email protected]> (aka Shine)
*
* 01-JUL-2007
*
* $Id$
*/
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspsircs.h>
#include <stdlib.h>
#include <string.h>
typedef int bool;
const bool false = 0;
const bool true = 1;
/* Define the module info section */
PSP_MODULE_INFO("SnapNType", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
/* Define printf, just to make typing easier */
#define printf pspDebugScreenPrintf
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
sceKernelExitGame();
return 0;
}
/* Callback thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void)
{
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0)
{
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
void clearScreen(void)
{
pspDebugScreenInit();
printf(" IrDA Type - Display text typed on a SnapNtype T806 keyboard\n");
printf(" based on IrDA sample by Shine\n");
printf(" CROSS: insert newline, SQUARE: clear screen, CIRCLE: quit\n");
printf("--------------------------------------------------------------------");
}
// The SnapNtype T806 keyboard sends a 4-byte packet for each keydown and another for
// each key up. These packets start with 0xC0 and 0xC1, with 2 unique scancode
// bytes at the end. The following structure is used to define table entries to map these
// 2-byte payloads into ASCII key values:
struct SCANCODE
{
unsigned char first; // First payload byte inside keycode packet
unsigned char second; // Second payload byte
unsigned char key; // ASCII key value
unsigned char shiftKey; // ASCII key value (shifted)
};
struct SCANCODE scanCodes[] =
{
{ 0xD1, 0x5E, 'a', 'A' },
{ 0x41, 0x42, 'b', 'B' },
{ 0xC1, 0x43, 'c', 'C' },
{ 0x41, 0x44, 'd', 'D' },
{ 0xC1, 0x45, 'e', 'E' },
{ 0xC1, 0x46, 'f', 'F' },
{ 0x41, 0x47, 'g', 'G' },
{ 0x51, 0x48, 'h', 'H' },
{ 0xD1, 0x49, 'i', 'I' },
{ 0xD1, 0x4A, 'j', 'J' },
{ 0x51, 0x4B, 'k', 'K' },
{ 0xD1, 0x4C, 'l', 'L' },
{ 0x51, 0x4D, 'm', 'M' },
{ 0x51, 0x4E, 'n', 'N' },
{ 0xD1, 0x4F, 'o', 'O' },
{ 0x41, 0x50, 'p', 'P' },
{ 0xC1, 0x51, 'q', 'Q' },
{ 0xC1, 0x52, 'r', 'R' },
{ 0x41, 0x53, 's', 'S' },
{ 0xC1, 0x54, 't', 'T' },
{ 0x41, 0x55, 'u', 'U' },
{ 0x41, 0x56, 'v', 'V' },
{ 0xC1, 0x57, 'w', 'W' },
{ 0xD1, 0x58, 'x', 'X' },
{ 0x51, 0x59, 'y', 'Y' },
{ 0x51, 0x5A, 'z', 'Z' },
{ 0x21, 0x30, '0', ')' },
{ 0xA1, 0x31, '1', '!' },
{ 0xA1, 0x32, '2', '@' },
{ 0x21, 0x33, '3', '#' },
{ 0xA1, 0x34, '4', '$' },
{ 0x21, 0x35, '5', '%' },
{ 0x21, 0x36, '6', '^' },
{ 0xA1, 0x37, '7', '&' },
{ 0xB1, 0x38, '8', '*' },
{ 0x31, 0x39, '9', '(' },
{ 0x11, 0x1B, '`', '~' },
{ 0x31, 0x2D, '-', '_' },
{ 0xB1, 0x3D, '=', '+' },
{ 0xD1, 0x5B, '[', '{' },
{ 0xD1, 0x5D, ']', '}' },
{ 0xB1, 0x3B, ';', ':' },
{ 0xB1, 0x2C, '\'', '"' },
{ 0x31, 0x3C, ',', '<' },
{ 0x31, 0x2E, '.', '>' },
{ 0xB1, 0x2F, '/', '?' },
{ 0x51, 0x5C, '\\', '|' },
{ 0x91, 0x0D, '\n', '\n' },
{ 0x11, 0x09, '\t', '\t' },
{ 0xA1, 0x20, ' ', ' ' }, // Left side of split Space bar
{ 0x21, 0x21, ' ', ' ' }, // Right side of split Space bar
// Modifier keys:
{ 0x01, 0x14, 0x80, 0x80 }, // Shift Toggle (Caps Lock)
{ 0x90, 0x90, 0x81, 0x81 }, // (Left) Shift OFF
{ 0x92, 0x92, 0x81, 0x81 }, // (Right) Shift OFF
{ 0x81, 0x10, 0x82, 0x82 }, // (Left) Shift ON
{ 0x01, 0x12, 0x82, 0x82 }, // (Right) Shift ON
{ 0x91, 0x91, 0x83, 0x83 }, // Ctrl OFF
{ 0x01, 0x11, 0x84, 0x84 }, // Ctrl ON
{ 0x9D, 0x9D, 0x85, 0x85 }, // Alt OFF
{ 0x11, 0x1D, 0x86, 0x86 }, // Alt ON
// TODO: Backspace {0x91, 0x08}
// TODO: Del {0x81, 0x13}
// TODO: Arrows: Up {0xA1, 0x26}, Down {0x31, 0x28}, Left{0x21, 0x27}, Right {0xA1, 0x25}
// TODO: Fn {0x11, 0x1E}
// TODO: Cmd key (windows Menu): {0x91, 0x1C}
// TODO: Programmable Function Button #1: {0x61, 0x71}
// TODO: Programmable Function Button #2: {0x61, 0x72}
// TODO: Programmable Function Button #3: {0xE1, 0x73}
// TODO: Programmable Function Button #4: {0x61, 0x74}
};
const int nScanCodes = sizeof(scanCodes) / sizeof(scanCodes[0]);
int main(void)
{
unsigned char scanCode[2] = {0, 0};
int byteCount = 0;
bool shift = false;
bool ctrl = false; // TODO: Ctrl keys printed in "^C" format.
bool alt = false; // TODO: Alt keystate currently ignored!
SceCtrlData pad;
u32 buttonsold = 0;
SetupCallbacks();
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(PSP_CTRL_MODE_DIGITAL);
clearScreen();
int fd = sceIoOpen("irda0:", PSP_O_RDWR, 0);
while (1)
{
// read pad
sceCtrlReadBufferPositive(&pad, 1);
if (pad.Buttons != buttonsold)
{
if (pad.Buttons & PSP_CTRL_CROSS)
printf("\n");
if (pad.Buttons & PSP_CTRL_SQUARE)
clearScreen();
if (pad.Buttons & PSP_CTRL_CIRCLE)
sceKernelExitGame();
buttonsold = pad.Buttons;
}
// check for IrDA input:
unsigned char data;
int len = sceIoRead(fd, &data, 1);
while (len == 1)
{
switch (byteCount)
{
case 0:
if (0xC1 == data)
byteCount++;
break;
case 1:
if (0xC0 == data)
byteCount++;
break;
case 2:
scanCode[0] = data;
byteCount++;
break;
case 3:
scanCode[1] = data;
byteCount++;
int n;
for (n=0; n<nScanCodes; n++)
{
if ((scanCode[0] == scanCodes[n].first)
&& (scanCode[1] == scanCodes[n].second))
{
if (scanCodes[n].key < 0x80)
{
// Display keypress character
if (ctrl)
printf("^");
printf("%c", (shift? scanCodes[n].shiftKey : scanCodes[n].key));
}
else
{
// Special modifier key:
switch (scanCodes[n].key & 0x7F)
{
case 0x00: // Shift Toggle
shift = !shift;
break;
case 0x01: // Shift OFF
shift = false;
break;
case 0x02: // Shift ON
shift = true;
break;
case 0x03: // Ctrl OFF
ctrl = false;
break;
case 0x04: // Ctrl ON
ctrl = true;
break;
case 0x05: // Alt OFF
alt = false;
break;
case 0x06: // Alt ON
alt = true;
break;
}
}
}
}
default:
byteCount = 0;
break;
}
//printf("%02X ", data);
len = sceIoRead(fd, &data, 1);
}
sceDisplayWaitVblankStart();
}
return 0;
}
saintshark
@saintshark :most likely it s not pikey u have to change it s libpspirkeyb and it s prx version .
maybe it s blocking and that s y u hear the sound try pressing the arrow keys very fast and the xmb will move .
if u want to give it a try
1. first u have to map the scancodes ur keyboard sends to to the values defined in "libpspirkey/include/pspirkeyb_rawkeys.h"
-sort them in ascending order in a an "uchar field".
-replace the existing one in this file /libpspirkey/kbdkeyboards.h for ur keyboard.
2.libpspirkey/pspirkeyb.c and either replace or modify the handler function
3. i just remembered :) the rest is well described in the README file . (about keymap,prototypes etc ), better u read it first .
4.compile it and test the prx as this is used by pikey
then u have to compile pikey using the modified version of libpspirkeyb
(dont foget the prx )
@J.F i tried sending it to fanjita but the email wasn't delivered , i ll try to send it to another of his e-adresses .
and
ne e problem i have though is when using pspvnc or pspssh (and most zx-81 s progs ) the enter key and del key dont work even if they work in the menu of those same applications .
if someone test it with another keyboard and not the TARGUS.
[/quote]
maybe it s blocking and that s y u hear the sound try pressing the arrow keys very fast and the xmb will move .
if u want to give it a try
1. first u have to map the scancodes ur keyboard sends to to the values defined in "libpspirkey/include/pspirkeyb_rawkeys.h"
-sort them in ascending order in a an "uchar field".
-replace the existing one in this file /libpspirkey/kbdkeyboards.h for ur keyboard.
2.libpspirkey/pspirkeyb.c and either replace or modify the handler function
3. i just remembered :) the rest is well described in the README file . (about keymap,prototypes etc ), better u read it first .
4.compile it and test the prx as this is used by pikey
then u have to compile pikey using the modified version of libpspirkeyb
(dont foget the prx )
@J.F i tried sending it to fanjita but the email wasn't delivered , i ll try to send it to another of his e-adresses .
and
ne e problem i have though is when using pspvnc or pspssh (and most zx-81 s progs ) the enter key and del key dont work even if they work in the menu of those same applications .
if someone test it with another keyboard and not the TARGUS.
[/quote]
I have a Palm 3169WW (their latest IR keyboard). The original Palm driver is blocking, and I modified it to not block. I also made a small change to the raw key mapping and made a keymap file to get many of the other keys (function keys, pgup, pgdn, home, end, etc). I sent those to fanjita's pikey email addy, but haven't checked the repo since then to see if my changes were entered.
Really old Palm code has a tendency to ignore most keys and lock on my Palm keyboard, despite being supposedly compatible. The old palm code was pretty bad, so it wasn't surprising. It wasn't just blocking, but really nasty as well. Easily able to lose bytes and wind up out of sync with the keyboard. I noticed that most of the drivers aren't really coded properly. For example, many simply try to read two bytes and ignore what would happen if only one byte were available. Maybe you're running into that.
Really old Palm code has a tendency to ignore most keys and lock on my Palm keyboard, despite being supposedly compatible. The old palm code was pretty bad, so it wasn't surprising. It wasn't just blocking, but really nasty as well. Easily able to lose bytes and wind up out of sync with the keyboard. I noticed that most of the drivers aren't really coded properly. For example, many simply try to read two bytes and ignore what would happen if only one byte were available. Maybe you're running into that.