There is an easier to read Microsoft word document version in the download file

How to use your MK64

Connect the PS/2 cable included with the MK64 to the Computer port on the MK64 and connect the other end to the computer port on your computer. Connect the IDC connector of your cable kit or a surplus 40,50 or 34 pin cable to the pins in the center of the MK64. The red stripe goes toward pin 1 labeled on the MK64. Each input line on the cable connects to a push button or joystick switch and the ground line connects to other contact on every switch. See kit instructions for more details.

Run INTEST.EXE, press all your controls and note the input numbers. Enter this information into a script file. Finally run KEYMAP.EXE on your script file.

MK64 New Features:

  1. F7 key can now be programmed in the key map and macros.
  2. There are now three key map banks (0, 1, 2)
  3. Typematic function is supported
  4. Startup settings
  5. Macro scripts have been added
  6. Dual rotary joystick support

The F7 key can now be programmed in the key map.

Previously the F7 key (83h) was incorrectly sent as (E003h)

Three key map banks (0, 1, 2)

Bank 0 is the default power on key map bank and just like the classic MK64 is stored in EEPROM.

Bank 1 is an alternate EEPROM key map bank. This bank also supports the other new features.

Bank 2 is stored in RAM and must be initialized before use.

In every bank the shift keys are stored in RAM and must be initialized before use. There is one exception. See Startup settings for details

Since Bank1 is used for many other purposes it maybe best to use BANKS 0 & 2 as your main hot swappable key map banks.

Typematic function

When enabled, Typematic will repeat the press code of the last key held down just like regular keyboards.

The default setting is Typematic disabled.

Startup settings

By placing a special key code for IN63 in BANK 1, The MK64 will change some of its start up values. See table below.

IN 63 $B1

SHIFT KEYS ON & DEFINED

IN 63 $B2

TYPEMATIC ENABLED

IN 63 $B3

SHIFT KEYS ON & DEFINED, TYPEMATIC ENABLED

If SHIFT KEYS ON & DEFINED is selected, the MK64 will pull the key codes from non-swapped input numbers 56 through 62 in BANK 1 and set those as SHIFT keys 1 through 7

Macro scripts

A single input can send up to 63 key codes on press and up to 63 key codes on release. Up to 16 macros can be defined at one time. At this time there is no macro generator available, but the files "macro1.csv" and "macr2.csv" when used with Microsoft Excel makes it relatively painless to generate a key map file. Be sure to replace all the commas with nothing using a text editor.

To assign a macro to an input requires setting the key map definition to M0 though M15 for macros 0 through 15. When that input is pressed, the MK64 will look at a key map setting for BANK1 inputs 00 through 15 based on which macro is requested. This value becomes a pointer to the macro’s press script count/type descriptor.

The macro scripts can reside in the memory used for BANK 1 inputs 00 through 71 (includes the shift status and 7 shifts key) and the same area in BANK 2 as well as 24 additional bytes beyond the "end" of BANK 2. This memory is contiguous as far as the macros are concerned.

The macro press script count/type descriptor holds the number of bytes remaining in the press sequence as well flags indicated below.

$00 + Length

On input release, send release codes matching the press codes (good for most macros)

$40 + Length

On input release, send a new set of press codes. (No "automatic" release codes are sent)

$80 + Length

Send matching release codes immediately after press codes.

$C0 + Length

Send matching release codes immediately after press codes. On input release, send a new set of press codes followed by it’s matching release codes. (good for toggles)

The rest of the bytes whose count was defined above are the key presses needed for the macro. In addition to all the normal key choices there are some special codes listed below. These special codes only work in macros.

BANK0

Switch immediately to key map BANK 0

BANK1

Switch immediately to key map BANK 1

BANK2

Switch immediately to key map BANK 2

REL-LAST

Send a release code matching the last press code sent

REL-NEXT

Forces the next byte in script to be sent as a release code

REL-LCTRL

Sends a release code for the left ctrl key

REL-LSHIFT

Sends a release code for the left shift key

REL-LALT

Sends a release code for the left alt key

DELAY

Delays for a time period of the (next byte / 10) seconds

When the macro is running, it will not be interrupted by other input key codes. Key codes from the pass through keyboard are not delayed.

If new key codes need to be sent on input release, the count/type descriptor and the specified number of following bytes must be place right after the end of the press codes. See examples below.

MK64 BOARD SELECTION

BANK 1 SET ACTIVE BANK TO ONE

NOSWAP IN40-63 WILL NOT BE BYTE SWAPPED MAKING MEMORY LINEAR

NORMAL IS BYTE SWAPPED TO MAKE INPUTS LINEAR

INPUT 00 $2B (43) POINTER TO MACRO 0

INPUT 43 $C5 5 BYTES FOR PRESS SCRIPT

INPUT 44 P

INPUT 45 R

INPUT 46 E

INPUT 47 S

INPUT 48 S

INPUT 49 $C7 7 BYTES FOR RELEASE SCRIPT

INPUT 50 R

INPUT 51 E

INPUT 52 L

INPUT 53 E

INPUT 54 A

INPUT 55 S

INPUT 56 E

On macro 1 press the mK64 will send ( ~ means a release code X is sent )

PRES~SS~P~R~E~S~S

On macro 1 release the mK64 will send ( ~X means a release code X is sent )

RELEASE~R~E~L~E~A~S~E

--------------------------------------------------------------------------------------------------

MK64 BOARD SELECTION

BANK 1 SET ACTIVE BANK TO ONE

NOSWAP IN40-63 WILL NOT BE BYTE SWAPPED MAKING MEMORY LINEAR

NORMAL IS BYTE SWAPPED TO MAKE INPUTS LINEAR

INPUT 01$2B (43) POINTER TO MACRO 1

INPUT 43 $0B 13 BYTES FOR PRESS SCRIPT

INPUT 44 A

INPUT 45 B

INPUT 46 B

INPUT 47 C

INPUT 48 REL-LAST

INPUT 49 REL-NEXT

INPUT 50 A

INPUT 51 LALT

INPUT 52 F4

INPUT 53 REL-LALT

INPUT 54 X

INPUT 55 DELAY

INPUT 56 $23 35 DEC = 3.5S

INPUT 57 Z

On macro 1 press the mK64 will send ( ~ means a release code X is sent )

A

B

~B Duplicate keys get an automatic release code

B

C

~C ‘C’ was the last key sent

~A ‘A’ is sent as a release, not a press

LEFT ALT

F4

~LEFT ALT

X

<Wait for 3.5 Seconds>

Z

On macro 1 release the mK64 will send ( ~ means a release code X is sent )

~A

~B

~B

~C

~A

~LALT

~F4

~X

~Z

Dual rotary joystick support

Two 12 position rotary joysticks are supported. Six inputs are required for each rotary. Rotary lines 1&7, 2&8, 3&9, 4&10, 5&11, and 6&12 are paired to 6 inputs whose key codes are set to R11, R12, R13, R14, R15, and R16 in that order for rotary one. Rotary two uses key codes R21, R22, R23, R24, R25, and R26.

The user definable variables and default values are listed in the table below.

Variable

Default Value in decimal

RAM location in decimal

ROTARY 1 CCW KEY CODE

26 "Z"

204

ROTARY 2 CCW KEY CODE

49 "N"

205

ROTARY 1 CW KEY CODE

34 "X"

206

ROTARY 2 CW KEY CODE

58 "M"

207

PRESS HOLD TIME (2.5mS per)

30 "75mS"

214

In MAME under analog controls set "dial key/joy speed" to 2 and "dial sensitivity" to 225%. You may need to tweak MAME to get a reliable one to one rotations.

 

General Support program information

The support programs work from DOS or a DOS window. They will not work with Windows NT/2000/XP with out loading a driver. In this text NT refers to NT, 2000, & XP.

I have included short cuts to the programs. These shortcuts expect the program files to be in "C:\MK" directory. The shortcuts won't work until you run the 'RUNFIRST' program that will rename the shortcuts. You only need to do this once.

If you know how to write a WIN32 program that replaces or interfaces with the windows keyboard driver, Please let me know!

The -a# option speeds up the program when running on NT because NTVDM, NT's DOS shell, doesn't support the ACK received bit. Most computers don't require an ACK return from the keyboard (or MK) so "-a0" (Zero not Oh) will be fine.

To run any MK program on NT first requires that the PORTTALK driver is installed and ALLOWIO.EXE has enabled the IOPM bits for NTVDM. The easiest way to do that is to click on the "Start Driver" shortcut.

To test the driver and find out if your computer requires an ACK from the keyboard, just click on 'Start Driver' shortcut then click on the "Need_ack"' short cut and follow the directions. The MK doesn't have to be installed for this test.

When using WIN NT be sure that the MK programs run in a full screen mode. I setup some short cuts for you to try and modify as needed.

When using the dos shell prompt (cmd.exe) be sure to start cmd.exe using the syntax below (Hit start button, select run)

c:\MK\AllowIO 0x60 cmd.exe

--------------------------------------------------------------------

User Support Programs

 

KEYMAP.EXE (Required), This programs your key map in to the MK64 memory

Syntax

KEYMAP <options> filename.ext

This program reads a text script file and assigns keystrokes to the MK40 or MK64's input lines.

The options supported are listed below...

-s Will only program the shift keys, normally used in the autoexec.bat for the MK64 only

-a# Sets the maximum wait time * 10mS for an ACK return. Only needed for NT users, # is a number 0 to 9 (0 will work for most users)

-v Verbose, outputs more detailed information.

-vv Outputs even more information

-q Quiet, outputs very little information.

-qq This even suppresses low level error messages

For example: C:\MK\KEYMAP C:\MK\common40.key

See forget.b0 & forget.b1 for script file examples.

These script files demonstrate input assignments, shift key assignment, start up options, macros, and rotary support. FORGET.BAT will program bank 0 and bank1 then return to bank 0.

------------------------------------------------------------------------

If the sample key map script files did not answer your questions, read this.

Commands must start in column one (left side) and are case insensitive. The keystroke assignments are also case insensitive. There can be only one command on each line.

Any line starting with a white space character is considered a comment line. Comment lines start with a white space character. Comments can follow commands if separated by a white space character.

Command List:

MKnn (where 'nn' is 40 or 64), sets the maximum number of inputs allowed by the program. This command should be used before any input is set.

INaaaaannwk (where 'aaaaa' is up to 5 non-digit characters, 'nn' is two digit input number 00 to 63, 'w' is a single white space character, and 'k' is the key stroke to be stored. This command assigns a key stroke to an input channel. Some valid examples are:

IN 00 e Assigns the 'E' key to input zero

Input23=esc Assigns the escape key to input 23

INP 63:RightShift Assigns the right shift key to input 63

Input 05=$9F Assigns hex code of any special keys that are not on the key map list

Any input set to key stroke "NUL" or "NULL" or not listed in the script file will disabled.

SHaaaaannwk sets up the shifted key codes and enables or disable the shift keys. The format is the same the IN command. Some examples are below.

SH 00 off Setting Shift line 00 to 'off' disables the

shifted keys. (The default is off)

Shift 00:ON Setting Shift line 00 to 'on' allows shifting

on inputs 1-7

SHIFT 01=K Assigns the 'K' key shift to input 01. Pressing button on input 01 will send 'K' if input 00 is currently pressed.

Shift 07:tab Assigns the 'TAB' key to shift input 07. (Inputs 8 - 63 are unaffected by shift function.)

NOSWAP will prevent the byte swapping on inputs 40 through 63. This is make the memory linear for make macro and start up assignments.

SKIP will not automatically write nulls ($00) to unassigned inputs.

TYPEMATIC ON will turn on the Typematic repeat feature. (Same as TYPE ON)

TYPEMATIC OFF will turn off the Typematic repeat feature. (Same as TYPE OFF)

BANK 0 will switch to key map bank 0 before programming. Bank 0 is the power on default key map bank. Inputs 00 to 63 and stored in EEPROM, but shift keys are stored in RAM and must be reprogrammed after power up unless startup options were saved.

BANK 1 will switch to key map bank 1 before programming. Bank 1 input’s 00 to 63 and stored in EEPROM, but shift keys are stored in RAM and must be reprogrammed after power up.

BANK 2 will switch to key map bank 2 before programming. Bank 2 is stored in RAM and must be reprogrammed after power up. Bank 2 supports inputs 72 to 93 for macro use only.

White space characters include space, tab, colon, and the equal sign.

Here is a list of valid keystrokes.

There are the obvious like A-Z, 0-9, and F1-F12.

There are also the non-shifted punctuation keys which are ` - = \ [ ] ; ' , . /

And there are the Num pad keys and named keys as follows

NUMLOCK NUM/ NUM* NUM- NUM+ NUMENTER NUM. NUM0

NUM1 NUM2 NUM3 NUM4 NUM5 NUM6 NUM7 NUM8 NUM9

ESC BACKSPACE TAB CAPSLOCK ENTER LEFTSHIFT RIGHTSHIFT

LEFTCTRL LEFTALT SPACE RIGHTALT RIGHTCTRL SCROLLLOCK

INSERT HOME PAGEUP DELETE END PAGEDOWN UP LEFT DOWN

RIGHT NUL NULL LEFTWIN RIGHTWIN TASKBAR PRINTSCRN

‘L’ or ‘R’ can replace the left and right prefixes.

For example LSHIFT and LEFTSHIFT are the same.

M0, M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14, and M15 will run macros 0 through 15 respectively.

R11, R12, R13, R14, R15, R16 are used for rotary axis one

R21, R22, R23, R24, R25, R26 are used for rotary axis two

OFF and ON are used for SHIFT 00 to disable or enable shift keys

BANK0, BANK1, BANK2, REL-LAST, REL-NEXT, REL-LCTRL, REL-LSHIFT, REL-LALT, and DELAY can only be used inside a macro sequence.

------------------------------------------------------------------------

REVISION.EXE (optional)

Syntax

Revision

Displays the number of inputs and the revision of the software on the MK's PIC. (Microcontroller) This program has no error checking, error correction, or no ACK issues. If the other programs fail to work be sure to try this program.

------------------------------------------------------------------------

INTEST.EXE (highly recommended), shows the status of all the inputs in real time

Syntax

INTEST <options>

This program allows you to test your switches and wiring. It can also detect inputs that are shorted to ground or to other inputs.

The options supported are listed below...

-a# Sets the maximum wait time * 10mS for an ACK return. Only needed for NT users, # is a number 0 to 9 (0 will work for most users)

The color codes are as follows...

CYAN Key is pressed and has been since starting the program

YELLOW Key is released and has been since starting the program

GREEN Key is currently pressed, but was released earlier

RED Key is currently released, but was pressed earlier

Press the ‘Esc’ key on your keyboard to exit this program.

------------------------------------------------------------------------

AUXOUT.EXE (optional), Sets the two auxiliary outputs)

Syntax

AUXOUT <options> n

Controls the two auxiliary outputs. 'n' is 0, 1, 2, or 3. AUX1 is the pin closest to the AUX label, the middle pin is ground, and the last pin is AUX2. The AUX1 output is bipolar and can drive the line low or high, while the AUX2 is an open drain line that can only drive low.

The options supported are listed below...

-a# Sets the maximum wait time * 10mS for an ACK return. Only needed for NT users, # is a number 0 to 9 (0 will work for most users)

-v Verbose, outputs more detailed information.

-vv Outputs even more information

n This value is required. See below

n=0 sets AUX1 low & AUX2 low

n=1 sets AUX1 high & AUX2 low

n=2 sets AUX1 low & AUX2 open (Hi-Z)

n=3 sets AUX1 high & AUX2 open (Hi-Z)

------------------------------------------------------------------------

READID.EXE (optional), Reads control panel’s ID number

Syntax

READID <options> n <n> <n> <n>

Reads ID from control panel. Valid 'n' values are 0 to 63 (single digit is allowed) the first 'n' is the MSB and the last 'n' is the LSB. If any 'n' inputs are shorted to ground (low) that will cause those bits to be 1 (high). Up to four inputs be can used. The result (0 to 15) is returned in DOS's ERRORLEVEL variable. Look at ID.BAT for more info.

The options supported are listed below...

-a# Sets the maximum wait time * 10mS for an ACK return. Only needed for NT users, # is a number 0 to 9 (0 will work for most users)

-v Verbose, outputs detailed information.

-vv Outputs even more information

------------------------------------------------------------------------

KEYCRACK.EXE (optional) Cause the MK to display hex codes for analysis

Syntax

KEYCRACK <options>

This program displays all the key codes from the MK as you type, move joysticks or press buttons. The codes for each action are separated with periods. The two digit codes in parenthesis are in key map format and can be placed in the key map script file. (example IN 39 $22 will program input 39 to the 'X' key which is hex 22) This may be useful for programming unique keys that are not listed in the key map program's key list.

The options supported are listed below...

-a# Sets the maximum wait time * 10mS for an ACK return. Only needed for NT users, # is a number 0 to 9 (0 will work for most users)

------------------------------------------------------------------------

WRITERAM.EXE (useful), Writes to internal MK RAM locations

Syntax

WRITERAM <options> a1 d1 <a2> <d2>...

This program writes to the MK's internal RAM to change the default settings. An example is: "WRITERAM 15 32" This disables the dual rate sampling. Setting that might make the special moves on games like Street Fighter 2 easier to perform. If you like the results, add this line to your autoexec.bat file.

The options supported are listed below...

-a# Sets the maximum wait time * 10mS for an ACK return. Only needed for NT users, # is a number 0 to 9 (0 will work for most users)

-v Verbose, outputs more detailed information.

-vv Outputs even more information

------------------------------------------------------------------------

BANK.EXE (useful), Changes the active key map bank.

Syntax

BANK <options> {0, 1, 2, A}

This program changes the active key map bank to 0, 1, or 2. BANK A will display the active bank.

The options supported are listed below...

-a# Sets the maximum wait time * 10mS for an ACK return. Only needed for NT users, # is a number 0 to 9 (0 will work for most users)

-v Verbose, outputs more detailed information.

-vv Outputs even more information

------------------------------------------------------------------------

Cable Kits Instructions

 

Cable kit A3 and A6

The first 25-wire ribbon cable (50 pin IDC with red wire on pin 1) has wires 1 and 2 as grounds. Wires 3, 4, & 5 are Caps Lock, Num Lock, & Scroll Lock LEDS. Wires 6 through 25 are input lines 00 to 19.

The second 25-wire ribbon cable (50 pin IDC with red wire at mid connector) has wires 1 through 15 are inputs 20 to 34. Wires 16 to 19 are not connected. Wires 20 through 24 are inputs 35 to 39. Wire 25 is a ground.

The third 25-wire ribbon cable (24 pin IDC) has wires 1 through 24 are inputs 40 to 63. Wire 25 is not connected.

Cable kit B and MK64 specials

Please refer to the lookup table that comes with the kit.

Cable kit C

The three black wires are grounds.

The three yellow wires connect to standard 2.1V LED anodes and the cathodes (flat side) connect to ground.

If you are planning to have shift keys enabled, use the wire that is uniquely colored for the shift key and the seven blue or green wires to your shift-able keys. Shift-able keys can two key codes each based on the shift key

The 56 white wires connect to your push buttons and joysticks in any order.

When wired, run INTEST and record the input map and edit the script file to match. Use KEYMAP to program the board.