Basilisk Ii Cross-Compile Working (68K Macintosh Emulator)


dgame

Active Member
Joined
Oct 1, 2006
Messages
945
Disclaimer: I am not a programmer. I am learning as I go and this is something I want on my Pandora.

I finally managed to cross-compile the Basilisk II 68K Macintosh Emulator and it works on the Pandora.
This is NOT an official release. It is a request for help.

I am using the DJWillis toolchain and have received lots of help setting it up from sebt3 and Hitnrun. Thanks!

Also thanks to Zx for sharing his SDK, I got the DJWillis toolchain to work first so I haven't tried it yet.


So here is the Basilisk II 68K Macintosh Emulator compiled for the Pandora. The keyboard and the mouse work. The sound works.
The touchscreen works but it shares a bug like with Xfce in that when the touchscreen is pressed and releases it does not register the mouse button as having been released.
The result is that the mouse always behaves as if it is being pressed when using the touch screen. If you try it you will see. The nub mouse works fine.

I don’t know how to make a PND yet so just extract the BasiliskII-app.zip folder to your SD card and execute “StartBasiliskII.sh” from the GUI (with the mouse or enter key) to run it.

The “StartBasiliskII.sh” script merely executes the ./BasiliskII program from the current directory or PWD.

This is important as I changed:
char *home = getenv("HOME");
to
char *home = getenv("PWD");
so it does not read or write the preference files from and to the NAND.

However, if you execute BasiliskII from the GUI (with the mouse or enter key) instead of using the StartBasiliskII.sh script the PWD will be the same as HOME and it will write to the NAND.

The StartBasiliskII.sh script is the same as executing BasiliskII from a terminal (./BasiliskII) as it preserves the PWD and the BasiliskII pref files get written and read form the BasiliskII folder.

Problems:
I cant get it to go full screen. When I attempt to compile with enable-xf86-dga the <X11/extensions/xf86dga.h> and <X11/extensions/xf86dga.h> are not in the Pandora tool chain I use.
The dga (frame buffer?) screen modes either don’t work or produce black screens.

When I double-click the title bar it (the title bar) disappears and the app goes full screen (in a window) for a few seconds and then the bar returns.

It is still workable as the 720x480 window is nice when Basilisk II is “always on top” or when Xfce panel is set to auto-hide.
You can use the left-shoulder button + drag window to have the entire 480 height visible.

I have uploaded the complete app and source here:

LINK to BasiliskII-app.zip (10.6MB)
LINK to BasiliskII-source.zip (1.8MB)


The BasiliskII-app.zip archive contains a pre-configured 20MB disk.hfv and should run without modification.
The BasiliskII-source.zip archive contains all of the source and the manually modified Makefile I used to compile the app.
Most of the Pandora related things are in the src/Unix folder of BasiliskII-source.zip.

Remember to always use the StartBasiliskII.sh script or launch the app from a terminal.

If you can compile it yourself and try to get full-screen working then go for it.

If you look at the code and have any suggestions to get full-screen working post them here and I can try it.


Thanks!
 
What happens if you run through minimenu? Is the XFCE window border still there?
 
@DaveC Through minimenu the XFCE window border is still there. However, when I double click the title bar Basilisk disappears and the minimenu appears.
Sometimes If I open the terminal again and get 'exit' to work then I get Basilisk without the title bar.
It is not consistent though as while the second terminal is running the minimenu is also still running and will launch other apps from the background.


@pcklee123 I used the GP2X port source code for this so it uses SDL.

Also if you run Basilisk from a terminal you get this information:
Code:
Basilisk II V1.0 by Christian Bauer et al.
sysinit
ERROR: Cannot install SIGSEGV handler (No such file or directory).
install handler quit
RAMSize = 8 MB
main_unix:vm_init
Mac RAM starts at 0x40599000 (00000000)
Mac ROM starts at 0x40d99000 (00000000)
Reading ROM file...
Using SDL/alsa audio output
Available video modes:
 320x240 (ID 80), 2 colors
 512x384 (ID 81), 2 colors
 640x480 (ID 82), 2 colors
 720x480 (ID 83), 2 colors
 720x576 (ID 84), 2 colors
 800x600 (ID 85), 2 colors
 320x240 (ID 80), 4 colors
 512x384 (ID 81), 4 colors
 640x480 (ID 82), 4 colors
 720x480 (ID 83), 4 colors
 720x576 (ID 84), 4 colors
 800x600 (ID 85), 4 colors
 320x240 (ID 80), 16 colors
 512x384 (ID 81), 16 colors
 640x480 (ID 82), 16 colors
 720x480 (ID 83), 16 colors
 720x576 (ID 84), 16 colors
 800x600 (ID 85), 16 colors
 320x240 (ID 80), 256 colors
 512x384 (ID 81), 256 colors
 640x480 (ID 82), 256 colors
 720x480 (ID 83), 256 colors
 720x576 (ID 84), 256 colors
 800x600 (ID 85), 256 colors
 320x240 (ID 80), 32768 colors
 512x384 (ID 81), 32768 colors
 640x480 (ID 82), 32768 colors
 720x480 (ID 83), 32768 colors
 720x576 (ID 84), 32768 colors
 800x600 (ID 85), 32768 colors
video_open()
Current video mode:
 640x480 (ID 82), 16 bpp
driver_window 640, 480, 16 
the_buffer = 0x417de000, the_buffer_copy = 0x41747008
monitor.mac_frame_base = a0000000
video_refresh = video_refresh_window_static
Initialization complete
60Hz thread started
XPRAM thread started
Starting emulation...
Button START up
video_close()
163 refreshes in 3420410 usec = 47.655106 refreshes/sec
 frame buffer unlocked
 releasing the_buffer at 0x417de000 (616960 bytes)
video_open()
Current video mode:
 720x480 (ID 83), 16 bpp
driver_window 720, 480, 16 
the_buffer = 0x43176000, the_buffer_copy = 0x4175a008
monitor.mac_frame_base = a0000000
video_refresh = video_refresh_window_static
QuitEmulator
video_close()
943 refreshes in 23462830 usec = 40.191230 refreshes/sec
 frame buffer unlocked
 releasing the_buffer at 0x43176000 (694080 bytes)
 
i've recompiled it and i've modified video_sdl.cpp and it works just fine :

./SDL/video_sdl.cpp
719c719
< if ((s = SDL_SetVideoMode(width, height, depth, SDL_HWSURFACE)) == NULL)
---
> if ((s = SDL_SetVideoMode(width, height, depth, SDL_HWSURFACE|SDL_FULLSCREEN)) == NULL)
 
zx-81 said:
i've recompiled it and i've modified video_sdl.cpp and it works just fine :

./SDL/video_sdl.cpp
719c719
< if ((s = SDL_SetVideoMode(width, height, depth, SDL_HWSURFACE)) == NULL)
---
> if ((s = SDL_SetVideoMode(width, height, depth, SDL_HWSURFACE|SDL_FULLSCREEN)) == NULL)

Thank you Zx-81!! It works beautifully!

Now, about this whole PND system . . . :unsure:
 
Last edited by a moderator:
dgame said:
Also if you run Basilisk from a terminal you get this information:
Code:
RAMSize = 8 MB

Any chance of bumping this up to 32 or 64MB?

Also, the stylus calibration is offset by about 3mm top-left when tapping.
 
Last edited by a moderator:
Back
Top