Software

The software for the ButtonBox2 has been developed using Atmel AVR Studio 3.10. The AVR Studio 3.10 software can be downloaded for free from Atmel.

To be able to download the software to the Atmel processor, I bought an Atmel STK200 Starter Kit (1MB pdf-manual). It costs around $50, so it's pretty cheap.

However, we have designed the ButtonBox2 so that it is possible to download the code to the Atmel CPU without the need of a special programmer. The software is downloaded to the Atmel CPU via the PC's parallel port using a special cable. You can download this software with instructions about how to build the needed cable from the Download page.

If you don't like this idea, you have to buy some sort of programmer to be able to download the software into the Atmel CPU. An Atmel STK200 Starter Kit can be used for this.

You can download the software needed to make the ButtonBox2 work from the Download page.


The default button mapping for the ButtonBox2 has been optimized for usage with MAME. Here is a description of the default button mapping for the ButtonBox2:

Button no Key Scan code* MAME function
1 Up 83 (53) Player 1, Up
2 Down 84 (54) Player 1, Down
3 Left 79 (4F) Player 1, Left
4 Right 89 (59) Player 1, Right
5 Left Control 58 (3A) Player 1, Button 1
6 Left Alt 60 (3C) Player 1, Button 2
7 Space 61 (3D) Player 1, Button 3
8 Left Shift 44 (2C) Player 1, Button 4
9 R 20 (14) Player 2, Up
10 F 34 (22) Player 2, Down
11 D 33 (21) Player 2, Left
12 G 35 (23) Player 2, Right
13 A 31 (1F) Player 2, Button 1
14 S 32 (20) Player 2, Button 2
15 Q 17 (11) Player 2, Button 3
16 W 18 (12) Player 2, Button 4
17 1 2 (02) 1 Player Start
18 2 3 (03) 2 Players Start
19 5 6 (06) Coin 1
20 6 7 (07) Coin 2
21 Escape 110 (6E) Exit Emulator
22 Enter 43 (2B)  
23 Tab 16 (10) Toggle Configuration Menu
24 P 26 (1A) Pause
25 T 21 (15) Tilt
26 Z 46 (2E) Player 1, Button 5
27 X 47 (2F) Player 1, Button 6
28 Right Ctrl 64 (40) Player 3, Button 1
29 3 4 (04) 3 Players Start
30 4 5 (05) 4 Players Start
31 7 8 (08) Coin 3
32 8 9 (09) Coin 4
33 0 11 (0B) Service 2
34 9 10 (0A) Service 1
35 C 48 (30) Player 1, Button 7
36 V 49 (31) Player 1, Button 8
37 I 24 (18) Player 3, Up
38 J 37 (25) Player 3, Left
39 K 38 (26) Player 3, Down
40 L 39 (27) Player 3, Right
41 E 19 (13)  
42 Right Shift 57 (39) Player 3, Button 2
43 B 50 (32) Player 1, Button 9
44 H 36 (24)  
45 M 52 (34)  
46 N 51 (33)  
47 O 25 (19)  
48 U 23 (17)  
49 Y 22 (16)  
50 Insert 75 (4B)  
51 Delete 76 (4C)  
52 Home 80 (50)  
53 End 81 (51)  
54 Page Up 85 (55)  
55 Page Down 86 (56)  
56 KeyPad 9 101 (65)  
57 KeyPad 1 93 (5D)  
58 KeyPad 2 98 (62)  
59 KeyPad 3 103 (67)  
60 KeyPad 4 92 (5C)  
61 KeyPad 5 97 (61)  
62 KeyPad 6 102 (66)  
63 KeyPad 7 91 (5B)  
64 KeyPad 8 96 (60)  

* = Values within parenthesis are hexadecimal.

 

Note that in "Direct" mode only the 27 first buttons can be used.

The ButtonBox2 is capable of re-mapping all these buttons to whatever the user wants.

If you build a 128-button Matrix-card, buttons 65-128 are not configured by default. Since the graphical version of the button configuration program (Bbxgui.exe) only can configure the 64 first buttons, you have to use the ButtonBox2 Scripting Tool (Bbxscr.exe) to configure buttons 65-128.

There are a few keys that the ButtonBox2 does not support at the moment. They are:

Left Windows key (I don't know the scan code for it, but my guess is that it is 59)
Right Windows key (I don't know the scan code for it, anyone who knows?)
Right Menu key (I don't know the scan code for it, anyone who knows?)

However, the ButtonBox2 DOES support the following keys (which the ButtonBox does not):

Print Screen (scan code 125)
Pause (scan code 127)

 


PC software

Robert Palmqvist has been kind enough to write a couple of PC programs that can be used to configure and test the ButtonBox2 from the PC. These programs can be downloaded from the Download page.

When configuring the ButtonBox2 using the ButtonBox scripting tool (Bbxscr.exe) , all values needed in the script is the so called keyboard scan codes. These are the codes that the software inside the keyboard uses when it scans the keyboard. Below are two pictures that shows which keys that has which scan codes. The scan codes are the values written in blue:

U.K. English keyboard. This is the way most countries have the buttons laid out on the keyboard.

(Click on the picture for larger view)

 

U.S. English keyboard. This differs a bit, it has a scan code 29 but is missing scan code 45.

(Click on the picture for larger view)

As far as I know, these are the only two keyboard layouts there is (apart from those with a number of "Internet keys" and other "rubber keys"). If you know of any other layouts, feel free to contact me about it.

 

 

Back to main page