New Version Of The 68k Macintosh Emulator Basilisk II
July 11, 2008 by Hawq
JF keeps up the rapid pace now with more updates to his port of this 68k Macintosh emulator for the PSP so let’s see what he’s done to it shall we? I’d go into some detail about what it’s like to use but I have little interest in Mac’s and haven’t tried it so its onwards to the news we go:
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 = 0×0010
RIGHT = 0×0020
DOWN = 0×0040
LEFT = 0×0080
LTRIGGER = 0×0100
RTRIGGER = 0×0200
TRIANGLE = 0×1000
CIRCLE = 0×2000
CROSS = 0×4000
SQUARE = 0×8000You can combine those to look for more than one button. For example, 0×6000 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, 0×0000
0×4000, 0×8000The 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:
0×4000 0×0000 256 255makes 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.
Here’s test 11! I made a minor change to the interpretation of the NOT SET field of the button map. It used to be any of the bits in the NOT SET field made it not match. Now it’s those set bits exactly. Makes the logic cleaner. You match the set bits against pad.Buttons, and the not set bits against ~pad.Buttons in the same manner. Think of it this way: you have a total of 10 bits to match against; the first field says to match if all the bits you specify are 1s; the seconds field says to match the bits you specify if they are 0s; any other bits are don’t-cares.
Big change for this update is memstick access!! Now I don’t have to put up with noobs whining about not being able to use HFVExplorer. The emulator will now mount the files directory in the B2 directory when enabled. If the files directory doesn’t exist, it’ll create it when you run B2. This is the “old standard” for putting Mac files on a non-HFS partition, using helper directories to store the finder info and resource fork. As far as noobs go, just put .sit/.bin/.hqx files in the directory, then drag them onto the hardfile once the emu is running. I don’t recommend installing software ONTO the stick. Although the helper directories should make it work, it’s not meant for that purpose. It’s really just an easier way to move files back and forth.
Um… test 12? Had a stupid goof in the new button code that (among other things) prevented you from naming a hardfile at format time. Also, once you enabled the memstick, it was on for life. Both are cleared up in test 12.
Download from the release thread or below.
Baslisk II For PSP (744.7 KiB, 51 Downloads) - Version Test 12
Baslisk II For PSP Source Code (2.2 MiB, 51 Downloads) - Version Test 12
Looking for our Basilisk II Page? Click below!
Basilisk II - Downloads, Screenshots, and More!



No comments yet.