Skip to content

Commit

Permalink
Merge pull request qmk#1 from marfrit/ibmpc_one_map
Browse files Browse the repository at this point in the history
Ibmpc one map
  • Loading branch information
marfrit authored Jun 23, 2021
2 parents d0133b0 + fa31ebc commit 0d82666
Show file tree
Hide file tree
Showing 8 changed files with 791 additions and 452 deletions.
59 changes: 59 additions & 0 deletions keyboards/converter/ibmpc_usb/ibmpc_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,62 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#include "ibmpc_usb.h"


const uint8_t map_cs1[MATRIX_ROWS][MATRIX_COLS] = {
{ XXX , 0x1a, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21 }, /* 00-07 */
{ 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x29, 0x33 }, /* 08-0F */
{ 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b }, /* 10-17 */
{ 0x3c, 0x3d, 0x3e, 0x3f, 0x57, 0x76, 0x4b, 0x4c }, /* 18-1F */
{ 0x4d, 0x4e, 0x4f, 0x50, 0x51, 0x52, 0x53, 0x54 }, /* 20-27 */
{ 0x55, 0x1b, 0x5f, 0x56, 0x61, 0x62, 0x63, 0x64 }, /* 28-2F */
{ 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6c, 0x2f }, /* 30-37 */
{ 0x77, 0x78, 0x4a, 0x0d, 0x0e, 0x0f, 0x10, 0x11 }, /* 38-3F */
{ 0x12, 0x13, 0x14, 0x15, 0x16, 0x2d, 0x31, 0x44 }, /* 40-47 */
{ 0x45, 0x46, 0x30, 0x59, 0x5a, 0x5b, 0x47, 0x70 }, /* 48-4F */
{ 0x71, 0x72, 0x7d, 0x7e, 0x5e, 0x48, 0x60, 0x17 }, /* 50-57 */
{ 0x18, XXX , 0x75, 0x74, 0x5d, XXX , XXX , XXX }, /* 58-5F */
{ 0x58, 0x6d, 0x7b, 0x6f, 0x01, 0x02, 0x03, 0x04 }, /* 60-67 */
{ 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x73 }, /* 68-6F */
{ XXX , 0x2a, 0x41, XXX , 0x2b, 0x42, 0x0c, 0x2c }, /* 70-77 */
{ 0x43, XXX , 0x7a, XXX , 0x79, XXX, 0x5c, 0x2e }, /* 78-7F */
};

const uint8_t map_cs2[MATRIX_ROWS][MATRIX_COLS] = {
{ 0x48, 0x15, 0x13, 0x11, 0x0F, 0x0D, 0x0E, 0x18 }, /* 00-07 */
{ 0x01, 0x16, 0x14, 0x12, 0x10, 0x33, 0x1B, 0x79 }, /* 08-0F */
{ 0x02, 0x77, 0x5F, XXX , 0x76, 0x34, 0x1C, 0x7A }, /* 10-17 */
{ 0x03, 0x75, 0x61, 0x4c, 0x4b, 0x35, 0x1D, 0x74 }, /* 18-1F */
{ 0x04, 0x63, 0x62, 0x4d, 0x36, 0x1F, 0x1E, 0x42 }, /* 20-27 */
{ 0x05, 0x78, 0x64, 0x4e, 0x38, 0x37, 0x20, 0x2B }, /* 28-2F */
{ 0x06, 0x66, 0x65, 0x50, 0x4f, 0x39, 0x21, 0x41 }, /* 30-37 */
{ 0x07, 0x2A, 0x67, 0x51, 0x3A, 0x22, 0x23, 0x7b }, /* 38-3F */
{ 0x08, 0x68, 0x52, 0x3B, 0x3c, 0x25, 0x24, 0x6f }, /* 40-47 */
{ 0x09, 0x69, 0x6a, 0x53, 0x54, 0x3d, 0x26, 0x58 }, /* 48-4F */
{ 0x0A, XXX , 0x55, 0x6d, 0x3E, 0x27, 0x43, 0x0B }, /* 50-57 */
{ 0x4a, 0x6C, 0x57, 0x3F, 0x5d, 0x28, 0x2C, 0x0C }, /* 58-5F */
{ 0x2e, 0x60, 0x73, 0x7f, XXX , XXX , 0x29, XXX }, /* 60-67 */
{ 0x56, 0x70, XXX , 0x59, 0x44, 0x5c, XXX , XXX }, /* 68-6F */
{ 0x7d, 0x7e, 0x71, 0x5a, 0x5b, 0x45, 0x1A, 0x2d }, /* 70-77 */
{ 0x17, 0x47, 0x72, 0x30, XXX , 0x46, 0x31, 0x5e }, /* 78-7F */
};

const uint8_t map_cs3[MATRIX_ROWS][MATRIX_COLS] = {
{ XXX , 0x75, 0x5e, 0x31, XXX , XXX , 0x1a, 0x0d }, /* 00-07 */
{ 0x01, 0x74, 0x5d, XXX , 0x48, 0x33, 0x1b, 0x0e }, /* 08-0F */
{ 0x02, 0x76, 0x5f, 0x60, 0x4a, 0x34, 0x1c, 0x0f }, /* 10-17 */
{ 0x03, 0x77, 0x61, 0x4c, 0x4b, 0x35, 0x1d, 0x10 }, /* 18-1F */
{ 0x04, 0x63, 0x62, 0x4d, 0x36, 0x1f, 0x1e, 0x11 }, /* 20-27 */
{ 0x05, 0x78, 0x64, 0x4e, 0x38, 0x37, 0x20, 0x12 }, /* 28-2F */
{ 0x06, 0x66, 0x65, 0x50, 0x4f, 0x39, 0x21, 0x13 }, /* 30-37 */
{ 0x07, 0x79, 0x67, 0x51, 0x3a, 0x22, 0x23, 0x14 }, /* 38-3F */
{ 0x08, 0x68, 0x52, 0x3b, 0x3c, 0x25, 0x24, 0x15 }, /* 40-47 */
{ 0x09, 0x69, 0x6a, 0x53, 0x54, 0x3d, 0x26, 0x16 }, /* 48-4F */
{ 0x0a, XXX , 0x55, 0x28, 0x3e, 0x27, 0x17, 0x0b }, /* 50-57 */
{ 0x7a, 0x6c, 0x57, 0x3f, 0x29, XXX , 0x18, 0x0c }, /* 58-5F */
{ 0x7b, 0x6d, 0x2b, 0x58, 0x41, 0x42, 0x29, 0x2a }, /* 60-67 */
{ 0x5c, 0x70, 0x6f, 0x59, 0x44, 0x43, 0x2b, 0x2c }, /* 68-6F */
{ 0x7d, 0x7e, 0x71, 0x5a, 0x5b, 0x45, 0x2d, 0x2e }, /* 70-77 */
{ XXX , 0x73, 0x72, 0x5c, 0x47, 0x46, 0x2f, 0x30 }, /* 78-7F */
};

113 changes: 38 additions & 75 deletions keyboards/converter/ibmpc_usb/ibmpc_usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define IBMPC_USB_H

#include "quantum.h"
#define XXX KC_NO

void matrix_init_user(void);

Expand All @@ -28,83 +29,43 @@ void matrix_init_user(void);
but the mapping is not finished yet.
*/

#define LAYOUT_105( \
K76, K05,K06,K04,K0C,K03,K0B,K02,K0A,K01,K09,K78,K07, K7F,K7E,K00, \
K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, K39,K2F,K5E, K77,K60,K7C,K7B, \
K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K37,K27,K56, K6C,K75,K7D, \
K58,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52,K5D,K5A, K6B,K73,K74,K79, \
K12,K61,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K59, K4F, K69,K72,K7A, \
K14,K19,K11, K29, K0F,K1F,K5C,K17, K53,K3F,K47, K70, K71,K62 \
) { \
{ K00, K01, K02, K03, K04, K05, K06, K07 }, \
{ KC_NO, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ KC_NO, K11, K12, KC_NO, K14, K15, K16, K17 }, \
{ KC_NO, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
{ KC_NO, K21, K22, K23, K24, K25, K26, K27 }, \
{ KC_NO, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \
{ KC_NO, K31, K32, K33, K34, K35, K36, K37 }, \
{ KC_NO, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \
{ KC_NO, K41, K42, K43, K44, K45, K46, K47 }, \
{ KC_NO, K49, K4A, K4B, K4C, K4D, K4E, K4F }, \
{ KC_NO, KC_NO, K52, K53, K54, K55, K56, KC_NO }, \
{ K58, K59, K5A, K5B, K5C, K5D, K5E, KC_NO }, \
{ K60, K61, K62, KC_NO, KC_NO, KC_NO, K66, KC_NO }, \
{ KC_NO, K69, KC_NO, K6B, K6C, KC_NO, KC_NO, KC_NO }, \
{ K70, K71, K72, K73, K74, K75, K76, K77 }, \
{ K78, K79, K7A, K7B, K7C, K7D, K7E, K7F } \
}
/*
F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24.
F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12.
#define LAYOUT_122( \
K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \
K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, \
\
K05,K06, K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K5D,K66, K67,K6E,K6F, K76,K77,K7E,K7F, \
K04,K0C, K0D,K15,K1D,K24,K2D,K2C,K35,K3C,K43,K44,K4D,K54,K5B, K5C, K64,K65,K6D, K6C,K75,K7D,K7C, \
K03,K0B, K14,K1C,K1B,K23,K2B,K34,K33,K3B,K42,K4B,K4C,K52, K53,K5A, K63, K6B,K73,K74,K7B, \
K02,K0A, K12,K13,K1A,K22,K21,K2A,K32,K31,K3A,K41,K49,K4A, K51,K59, K61,K62,K6A, K69,K72,K7A,K79, \
K01,K09, K11, K19, K29, K39, K58, K60, K68,K70,K71,K78 \
) { \
{ KC_NO, K01, K02, K03, K04, K05, K06, K07 }, \
{ K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
{ K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
{ K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
{ K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \
{ K40, K41, K42, K43, K44, K45, K46, K47 }, \
{ K48, K49, K4A, K4B, K4C, K4D, K4E, K4F }, \
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
{ K58, K59, K5A, K5B, K5C, K5D, K5E, K5F }, \
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
{ K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \
{ K70, K71, K72, K73, K74, K75, K76, K77 }, \
{ K78, K79, K7A, K7B, K7C, K7D, K7E, K7F } \
}
RST, ESC, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, -, =, STB,BSP, INS, HOM, PUP, NLK, SLS, AST, MNS,
SLK, MPL, TAB, Q, W, E, R, T, Y, U, I, O, P, [, ], STB DEL, END, PDN, 7, 8, 9, PLS,
BRK, INT5, CLK, A, S, D, F, G, H, J, K L, ;, ', \, ENT, UP, 4, 5, 6, COM,
APP, PSC, LSF, <, Z, X, C, V, B, N, M, ,, ., /, STB RSF, LFT, SHT, RGT, 1, 2, 3, ENT,
RGU, LGU, LCL, LAT, SPC, RAT, RCL, DN, STB, 0, STB, DOT
#define LAYOUT_xt( \
K3B, K3C, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K45, K46, \
K3D, K3E, K0F, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K47, K48, K49, K4A, \
K3F, K40, K1D, K1E, K1F, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K1C, K4B, K4C, K4D, \
K41, K42, K2A, K2B, K2C, K2D, K2E, K2F, K30, K31, K32, K33, K34, K35, K36, K37, K4F, K50, K51, K4E, \
K43, K44, K38, K39, K3A, K52, K53 \
*/
#define LAYOUT(\
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \
K0D, K0E, K0F, K10, K11, K12, K13, K14, K15, K16, K17, K18, \
\
K19, K1A, K1B, K1C, K1D, K1E, K1F, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K30, \
K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K40, K41, K42, K43, K44, K45, K46, K47, \
K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, \
K5D, K5E, K5F, K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C, K6D, K6E, K6F, K70, K71, K72, K73, \
K74, K75, K76, K77, K78, K79, K7A, K7B, K7C, K7D, K7E, K7F \
) { \
{ KC_NO, K01, K02, K03, K04, K05, K06, K07 }, \
{ K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
{ K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
{ K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
{ K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \
{ K40, K41, K42, K43, K44, K45, K46, K47 }, \
{ K48, K49, K4A, K4B, K4C, K4D, K4E, K4F }, \
{ K50, K51, K52, K53, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \
{ KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \
{ XXX, K01, K02, K03, K04, K05, K06, K07 }, \
{ K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \
{ K10, K11, K12, K13, K14, K15, K16, K17 }, \
{ K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \
{ K20, K21, K22, K23, K24, K25, K26, K27 }, \
{ K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \
{ K30, K31, K32, K33, K34, K35, K36, K37 }, \
{ K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \
{ K40, K41, K42, K43, K44, K45, K46, K47 }, \
{ K48, K49, K4A, K4B, K4C, K4D, K4E, K4F }, \
{ K50, K51, K52, K53, K54, K55, K56, K57 }, \
{ K58, K59, K5A, K5B, K5C, K5D, K5E, K5F }, \
{ K60, K61, K62, K63, K64, K65, K66, K67 }, \
{ K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \
{ K70, K71, K72, K73, K74, K75, K76, K77 }, \
{ K78, K79, K7A, K7B, K7C, K7D, K7E, K7F } \
}

typedef enum { NONE, PC_XT, PC_AT, PC_TERMINAL, PC_AT_Z150 } keyboard_kind_t;
Expand All @@ -116,5 +77,7 @@ typedef enum { NONE, PC_XT, PC_AT, PC_TERMINAL, PC_AT_Z150 } keyboard_kind_t;

extern uint16_t keyboard_id;
extern keyboard_kind_t keyboard_kind;

extern const uint8_t map_cs1[MATRIX_ROWS][MATRIX_COLS];
extern const uint8_t map_cs2[MATRIX_ROWS][MATRIX_COLS];
extern const uint8_t map_cs3[MATRIX_ROWS][MATRIX_COLS];
#endif
Loading

0 comments on commit 0d82666

Please sign in to comment.