From f68c5bf0d30dc1300c71dabc63d2c2970f7337c9 Mon Sep 17 00:00:00 2001 From: tmk Date: Fri, 22 Feb 2013 09:53:46 +0900 Subject: Add initial files for PC98 --- converter/pc98_usb/matrix.c | 179 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 179 insertions(+) create mode 100644 converter/pc98_usb/matrix.c (limited to 'converter/pc98_usb/matrix.c') diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c new file mode 100644 index 000000000..b3c11dc21 --- /dev/null +++ b/converter/pc98_usb/matrix.c @@ -0,0 +1,179 @@ +/* +Copyright 2012 Jun Wako + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +#include +#include +#include +#include +#include "print.h" +#include "util.h" +#include "matrix.h" +#include "debug.h" +#include "protocol/serial.h" + + +/* + * Matrix Array usage: + * + * ROW: 16(4bits) + * COL: 8(3bits) + * + * 8bit wide + * +---------+ + * 0|00 ... 07| + * 1|08 ... 0F| + * :| ... | + * :| ... | + * E|70 ... 77| + * F|78 ... 7F| + * +---------+ + */ +static uint8_t matrix[MATRIX_ROWS]; +#define ROW(code) ((code>>3)&0xF) +#define COL(code) (code&0x07) + +static bool is_modified = false; + + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + print_enable = true; + debug_enable = true; + + PC98_RST_DDR |= (1< Date: Fri, 22 Feb 2013 15:48:35 +0900 Subject: Quick Fix: read scan code from PC98 --- converter/pc98_usb/matrix.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'converter/pc98_usb/matrix.c') diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c index b3c11dc21..ef2bc3818 100644 --- a/converter/pc98_usb/matrix.c +++ b/converter/pc98_usb/matrix.c @@ -73,6 +73,8 @@ void matrix_init(void) PC98_RDY_PORT |= (1< Date: Fri, 22 Feb 2013 19:37:27 +0900 Subject: Add keymap for PC98 --- converter/pc98_usb/matrix.c | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'converter/pc98_usb/matrix.c') diff --git a/converter/pc98_usb/matrix.c b/converter/pc98_usb/matrix.c index ef2bc3818..2f1e821c5 100644 --- a/converter/pc98_usb/matrix.c +++ b/converter/pc98_usb/matrix.c @@ -65,6 +65,7 @@ void matrix_init(void) { print_enable = true; debug_enable = true; + //debug_matrix = true; PC98_RST_DDR |= (1<