pc98_usb: Fix RDY line and startup for PC-9801V

This commit is contained in:
tmk 2018-10-15 21:37:52 +09:00
parent 594d7d85da
commit fddc6a7b47
3 changed files with 24 additions and 11 deletions

View file

@ -170,14 +170,21 @@ NOTES
### RDY
Current firmware does not control RDY line and it is drived as low to receive data always. While sending command firmware drive the line high.
PC98 host keeps RDY line high to prevent keyboard from sending data while processing.
https://archive.org/stream/PC9800TechnicalDataBookHARDWARE1993/PC-9800TechnicalDataBook_HARDWARE1993#page/n359
PC-9801V keyboard requires RDY pulse as acknowledgement from host, it doesn't next data without this. Dboard doens't need this.
### Inhibit key repeating
The command(9Ch, 70h) works with Raku Raku keybaord but not with Dboard.
### LED indicater
Dboard has LEDs but it seems to ignore LED control command.
Dboard has LEDs but replys with FA to 9D command but ignore it. The LED indicates just its internal states. Dboard replays with FA to 9C command but it doesn't seem to understand repeat setting.
PC-9801V has no LEDs and doesn't accept LED command. It replys with 9D to 9D command. PC-9801V doesn't accept repeat setting command. It replys with 9C to 9C command.
## PC-9801V
Note that you have to connect this keyboard with converter before plug in USB port. It seems this keyboard requires for host to send any command before starting to send scan code.

View file

@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define CONFIG_H
#define VENDOR_ID 0xFEED
#define PRODUCT_ID 0x9898
#define DEVICE_VER 0x0100
#define PRODUCT_ID 0x9801
#define DEVICE_VER 0x0101
#define MANUFACTURER t.m.k.
#define PRODUCT PC98 keyboard converter
#define DESCRIPTION converts PC98 keyboard protocol into USB

View file

@ -71,12 +71,12 @@ static void pc98_inhibit_repeat(void)
RETRY:
pc98_send(0x9C);
code = pc98_wait_response();
if (code != -1) xprintf("PC98: send 9C: %02X\n", code);
if (code != 0xFA) goto RETRY;
if (code != -1) xprintf("send 9C: %02X\n", code);
if (code != 0xFA) return;
pc98_send(0x70);
code = pc98_wait_response();
if (code != -1) xprintf("PC98: send 70: %02X\n", code);
if (code != -1) xprintf("send 70: %02X\n", code);
if (code != 0xFA) goto RETRY;
}
@ -87,12 +87,12 @@ static void pc98_led_set(void)
RETRY:
pc98_send(0x9D);
code = pc98_wait_response();
if (code != -1) xprintf("PC98: send 9D: %02X\n", code);
if (code != 0xFA) goto RETRY;
if (code != -1) xprintf("send 9D: %02X\n", code);
if (code != 0xFA) return;
pc98_send(pc98_led);
code = pc98_wait_response();
if (code != -1) xprintf("PC98: send %02X: %02X\n", pc98_led, code);
if (code != -1) xprintf("send %02X: %02X\n", pc98_led, code);
if (code != 0xFA) goto RETRY;
}
@ -158,6 +158,12 @@ uint8_t matrix_scan(void)
matrix[ROW(code)] |= (1<<COL(code));
}
}
// PC-9801V keyboard requires RDY pulse.
// This is not optimal place though, it works.
PC98_RDY_PORT |= (1<<PC98_RDY_BIT); // RDY: high
_delay_us(20);
PC98_RDY_PORT &= ~(1<<PC98_RDY_BIT); // RDY: low
return code;
}