Time for another update! Test 10 adds input mapping. There's nothing in the GUI for it at this time - you have to make them with a text editor and then copy them to the imaps directory in the B2 directory. Like the other directories, it'll create it if it doesn't exist when you run B2. Input maps are selected and loaded just like floppies and cdroms - press SELECT in the emulation and press right/left to switch between imaps, floppies, and cdroms. Press up/down to select the specific file. With imaps, pressing CROSS parses the button map file. I include a file that is the same as the defaults used when the program starts - that allows you to go back to them after using another imap.
The format is deceptively simple - it's just one or more lines of four numbers. The first two are in hexadecimal and represent the buttons that should be pressed, and shouldn't be pressed, respectively. This is the same value as the defines from pspctrl.h:
Code:
UP = 0x0010
RIGHT = 0x0020
DOWN = 0x0040
LEFT = 0x0080
LTRIGGER = 0x0100
RTRIGGER = 0x0200
TRIANGLE = 0x1000
CIRCLE = 0x2000
CROSS = 0x4000
SQUARE = 0x8000
You can combine those to look for more than one button. For example, 0x6000 is both CROSS and CIRCLE at the same time. The reason for having a value for buttons that SHOULDN'T be pressed is to allow for one or more buttons to be used as a qualifer. For example,
0xC000, 0x0000
0x4000, 0x8000
The first says to look for BOTH SQUARE and CROSS, while the second says to look for CROSS and NOT SQUARE. That makes SQUARE a qualifier that changes the meaning of CROSS depending on if it's pressed or not. This allows for more combinations of buttons than is useful, but I didn't want to limit people too much.
The next two numbers on each line are in decimal and represent the key(s)/mouse button(s) to press. For Mac keycodes, look at the keycodes file in the unix directory of the source. The second column of numbers is the decimal value of the Mac key shown after the # symbol. There are also pictures floating around the net that show the value of the keys over top an image of the keyboard. Use 255 to represent nothing. 256 represents mouse button 1 and 257 mouse button 2. You get two codes, so you can do one or two keys, a key and a mouse button, or any such combination.
So a line in the file of
Code:
0x4000 0x0000 256 255
makes the X the mouse button. Remember to make that second code 255 when not being used! 0 is a valid keycode for the Mac, so 0 doesn't cut it. I use 255 for just that reason.
You are currently limited to a maximum of 64 input mappings. I can change that if people want more, but it should be enough for nearly everyone.
The default mapping is currently:
d-pad = cursor keys
ltrigger = mouse button 1
rtrigger = mouse button 2 (although I'll probably change this to CTRL+MB1 for contextual menus)
cross = enter
square = tab
circle = CMD+W (close window)
triangle = CMD+Q (quit)
I fixed a bug in the OSK where the Command key got stuck once you used it. It's why people reported that sometimes the OSK quit working - it was still working, but the CMD qualifier was stuck.
I also added the ability to create blank floppies in the Create Hardfile sub-menu of the Volumes sub-menu. It makes a blank 1.44 MB file that you can then insert and format in the emulation from the Mac desktop.