Basiliskii-mac Emulator


pcklee123

Member
Joined
Nov 14, 2003
Messages
403
I'm trying to compile BasiliskII for gp2x. I'm using Oopo's toolchain.

EDIT
I tried to get some joystick code (copied from sdltest.cpp) into video_sdl.cpp but it doesn't do any thing at all. Can anyone give me some hints here what to do next? I have SDL_Init with JOYSTICKINIT flag as well in main_unix.cpp

the source is at
http://www.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,46,1353
Edit
It compiles and sort of works. Mouse and keyboard doesn't work. It probably needs a real dev to rewrite the code so that it works. I dont know enough to do it(unless someone can give me a lot of guidance)
Anyway the binary is at
http://www.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,5,1351
It feels fast enough to be useful. Adobe photoshop, Aldus Pagemaker, MSWord, MSExcel on the GP2X
 
Can't help I'm afraid but good luck!

theme-mac1984.gif


:)

®
 
Shirohagen posted on Feb 28 2006 at 11:33 AM said:
Can't help I'm afraid but good luck!

:)

®
It says on the download page that the program compile but doesn't run so I guess we will have to wait for a new version...
 
Last edited by a moderator:
pcklee123 posted on Mar 1 2006 at 12:16 AM said:
I'm trying to compile BasiliskII for gp2x. It compiles but doesnt work. I'm using Oopo's toolchain.

It gives the following error when it runs on gp2x
Basilisk II V1.0 by Christian Bauer et al.
ERROR: Cannot install SIGSEGV handler (No such file or directory).

What is SIGSEGV?

the source is at

http://archive.gp2x.de/cgi-bin/cfiles.cgi?0,0,0,0,46,1305

A simple Google search on your error text brought up multiples of pages with more information:

Google search concerning SIGSEGV
 
Last edited by a moderator:
That doesn't make a lot of sense :p

SIGSEGV is the signal name for seg-fault, which is what happens when you do coding errors on a given architecture.

there are various APIs for hooking up signal handlers, so that an application can programmatically respond to a signal (ie: an error, or a user defined signal, or a system signal, or various things.)

The GP2X is on the Linux kernel, and so supports signals, more or less POSIX compliant even.

I wonder how basilisk is setting them, if not using the regular APIs? Or perhaps the error means something else entirely.

jeff
 
Suggest you add a few printfs, or even run the thing through gdb to see what exactly happens.

Good luck debugging!

Pieter

P.S.

might be a red herring but:
Looking at sigsegv.cpp, it tries to init vm etc. and returns a numeric constant when something goes wrong there, and the numebr is misinterpreted by whatever prints the error:

from sigsegv.cpp:

Code:
int main(void)
{
        if (vm_init() < 0)
                return 1;

        page_size = vm_get_page_size();
        if ((page = (char *)vm_acquire(page_size)) == VM_MAP_FAILED)
                return 2;


Code:
luteijn@dollar:~/zut/BasiliskII-1.0rc1/src/Unix$ perror 2
System error:   2 = No such file or directory
 
Thanks everyone. Found the line which cause the problem, in main_unix.cpp. just removed quit_emulator() after that line and it continues without installing the sigsev handler thing. (updated the source)
It starts up with a 640x480x16 screen which gets changed to a 640x480 1 bit screen(error message on mac?) but can't see whats on it cause screen is squeezed to about 1/8th of the GP2X screen on the left.
Probably needs work on keyboard and mouse.
Any suggestions
 
This is what I get on the the serial console. Something shows up on screen I think its probably an alert but I have no way of clicking OK.

Code:
Basilisk II V1.0 by Christian Bauer et al.
SDL_GP2X: CreateDevice
SDL_GP2X: VideoInit
SDL_GP2X: Physical screen = 320x240 (ilace = 0)
SDL_GP2X: Creating cursor 16x16
SDL_GP2X: Allocated WMcursor @ 0x2b2fb8 (32)
SDL_GP2X: SurfaceManager allocating 256 bytes
sysinit
ERROR: Cannot install SIGSEGV handler (Permission denied).
install handler quit
RAMSize = 16 MB
main_unix:vm_init
Mac RAM starts at 0x40511000 (00000000)
Mac ROM starts at 0x41511000 (00000000)
Reading ROM file...
Using SDL/dsp audio output
SDL_GP2X: ListModes
SDL_GP2X: ListModes
SDL_GP2X: ListModes
SDL_GP2X: ListModes
SDL_GP2X: ListModes
SDL_GP2X: ListModes
Available video modes:
 512x384 (ID 80), 2 colors
 640x480 (ID 81), 2 colors
 800x600 (ID 82), 2 colors
 1024x768 (ID 83), 2 colors
 1152x870 (ID 84), 2 colors
 1280x1024 (ID 85), 2 colors
 1600x1200 (ID 86), 2 colors
 512x384 (ID 80), 4 colors
 640x480 (ID 81), 4 colors
 800x600 (ID 82), 4 colors
 1024x768 (ID 83), 4 colors
 1152x870 (ID 84), 4 colors
 1280x1024 (ID 85), 4 colors
 1600x1200 (ID 86), 4 colors
 512x384 (ID 80), 16 colors
 640x480 (ID 81), 16 colors
 800x600 (ID 82), 16 colors
 1024x768 (ID 83), 16 colors
 1152x870 (ID 84), 16 colors
 1280x1024 (ID 85), 16 colors
 1600x1200 (ID 86), 16 colors
 512x384 (ID 80), 256 colors
 640x480 (ID 81), 256 colors
 800x600 (ID 82), 256 colors
 1024x768 (ID 83), 256 colors
 1152x870 (ID 84), 256 colors
 1280x1024 (ID 85), 256 colors
 1600x1200 (ID 86), 256 colors
 512x384 (ID 80), 32768 colors
 640x480 (ID 81), 32768 colors
 800x600 (ID 82), 32768 colors
 1024x768 (ID 83), 32768 colors
 1152x870 (ID 84), 32768 colors
 1280x1024 (ID 85), 32768 colors
 1600x1200 (ID 86), 32768 colors
video_open()
Current video mode:
 640x480 (ID 81), 16 bpp
SDL_GP2X: ListModes
SDL_GP2X: Setting video mode 640x480 16 bpp, flags=1
SDL_GP2X: FreeHWSurfaces
SDL_GP2X: InitHWSurfaces 0x40097000, 4624384
SDL_GP2X: Screen bucket 0x2b255c
SDL_GP2X: First free bucket 0x2d1c90 (size = 4624384)
SDL_GP2X: Creating cursor 16x16
SDL_GP2X: Allocated WMcursor @ 0x2d1ca8 (32)
SDL_GP2X: SurfaceManager allocating 256 bytes
SDL_GP2X: SurfaceManager adding new free bucket of 4624128 bytes @ 0x2d1cc0
SDL_GP2X: SurfaceManager allocated 256 bytes at 0x40097000
the_buffer = 0x416a8000, the_buffer_copy = 0x41611008
monitor.mac_frame_base = a0000000
Initialization complete
60Hz thread started
XPRAM thread started
Starting emulation...
video_close()
186 refreshes in 6742464 usec = 27.586354 refreshes/sec
 frame buffer unlocked
 releasing the_buffer at 0x416a8000 (616960 bytes)
video_open()
Current video mode:
 640x480 (ID 81), 1 bpp
SDL_GP2X: ListModes
SDL_GP2X: Setting video mode 640x480 8 bpp, flags=1
SDL_GP2X: FreeHWSurfaces
SDL_GP2X: Freeing bucket 0x2d1c90 (size 256)
SDL_GP2X: Freeing bucket 0x2d1cc0 (size 4624128)
SDL_GP2X: InitHWSurfaces 0x4004c000, 4931584
SDL_GP2X: Screen bucket 0x2b255c
SDL_GP2X: First free bucket 0x2d1cc0 (size = 4931584)
SDL_GP2X: Freeing cursor 0x2d1ca8
SDL_GP2X: SurfaceManager freeing 256 bytes @ 0x40097000 from bucket 0x2d1c90
SDL_GP2X: merging with next bucket (0x2d1cc0) making 4931840 bytes
SDL_GP2X: Creating cursor 16x16
SDL_GP2X: Allocated WMcursor @ 0x2cf828 (32)
SDL_GP2X: SurfaceManager allocating 256 bytes
the_buffer = 0x4165d000, the_buffer_copy = 0x41611008
monitor.mac_frame_base = a0000000
 
If you start up with a hard disk image with a recent system (7 or 8) installed, the screen is OK
 
Can anyone help me with this?
I want the mouse to follow the joystick but if I hold down the joystick, the mouse position just moves one and stops. I want it to continue moving until I let go of the joystick.

Code:
static int joyx,joyy;
static int move,dirn;




static void handle_events(void)
{
	SDL_Event events[10],event1;
	const int n_max_events = sizeof(events) / sizeof(events[0]);
	int n_events;
	int widthx=640;
	int widthy=480;
	while ((n_events = SDL_PeepEvents(events, n_max_events, SDL_GETEVENT, sdl_eventmask)) > 0) {
	//	printf ("handle events: PeepEvents\n");
  for (int i = 0; i < n_events; i++) 
  	{
  	SDL_Event const & event = events[i];
  	switch (event.type) 
  	{
  	case SDL_JOYBUTTONDOWN:{
    	printf ("handle events: joybuttondown move=%i\n",move);
    	switch( event.jbutton.button )
    	{
      case GP2X_BUTTON_CLICK:
      //	printf("Joystick BUTTON\n");
      	break;
      case GP2X_BUTTON_START:
      //	printf("Button START\n");
      	break;
      case GP2X_BUTTON_SELECT:
      	break;
      case GP2X_BUTTON_VOLUP:
      	break;
      case GP2X_BUTTON_VOLDOWN:
    
      	break;
      case GP2X_BUTTON_LEFT :
      	joyx--;
      	if (joyx<0) joyx=0;
      	//printf("mouse_moved %i, %i\n",joyx,joyy);
      	drv->mouse_moved(joyx, joyy);
      	move=1;
      	dirn=GP2X_BUTTON_LEFT;
      	break;
      case GP2X_BUTTON_RIGHT :
      	joyx++;
      	if (joyx>widthx) joyx=widthx;
      	//printf("mouse_moved %i, %i\n",joyx,joyy);
      	drv->mouse_moved(joyx, joyy);
      	move=1;
      	dirn=GP2X_BUTTON_RIGHT;
      	break;
      case GP2X_BUTTON_UP :
      	joyy--;
      	if (joyy<0) joyy=0;
      	//printf("mouse_moved %i, %i\n",joyx,joyy);
      	drv->mouse_moved(joyx, joyy);
      	move=1;
      	dirn=GP2X_BUTTON_UP;
      	break;
      case GP2X_BUTTON_DOWN :
      	joyy++;
      	if (joyy>widthy) joyy=widthy;
      	//printf("mouse_moved %i, %i\n",joyx,joyy);
      	drv->mouse_moved(joyx, joyy);
      	move=1;
      	dirn=GP2X_BUTTON_DOWN;
      	break;
      case GP2X_BUTTON_UPLEFT :
      	joyx--;
      	joyy--;
      	if (joyx<0) joyx=0;
      	if (joyy<0) joyy=0;
      	//printf("mouse_moved %i, %i\n",joyx,joyy);
      	drv->mouse_moved(joyx, joyy);
      	move=1;
      	dirn=GP2X_BUTTON_UPLEFT;
      	break;
      case GP2X_BUTTON_DOWNRIGHT :
      	joyx++;
      	joyy++;
      	if (joyy>widthy) joyy=widthy;
      	if (joyx>widthx) joyx=widthx;
      	//printf("mouse_moved %i, %i\n",joyx,joyy);
      	drv->mouse_moved(joyx, joyy);
      	move=1;
      	dirn=GP2X_BUTTON_DOWNRIGHT;
      	break;
      case GP2X_BUTTON_UPRIGHT :
      	joyy--;
      	joyx++;
      	if (joyx>widthx) joyx=widthx;
      	if (joyy<0) joyy=0;
      	//printf("mouse_moved %i, %i\n",joyx,joyy);
      	drv->mouse_moved(joyx, joyy);
      	move=1;
      	dirn=GP2X_BUTTON_UPRIGHT;
      	break;
      case GP2X_BUTTON_DOWNLEFT :
      	joyy++;
      	joyx--;
      	if (joyx<0) joyx=0;
      	if (joyy>widthy) joyy=widthy;
      	//printf("mouse_moved %i, %i\n",joyx,joyy);
      	drv->mouse_moved(joyx, joyy);
      	move=1;
      	dirn=GP2X_BUTTON_DOWNLEFT;
      	break;
      case GP2X_BUTTON_Y:
    	
      	break;
      case GP2X_BUTTON_B:
      {
      	ADBMouseDown(0);
      	break;
      }
      case GP2X_BUTTON_X :
    	
      	break;
      case GP2X_BUTTON_A :
    	
      	break;
      case GP2X_BUTTON_L :
    	
      	break;
      case GP2X_BUTTON_R :
    	
      	break;
      default:
      	break;
    	}
    }
  	case SDL_JOYBUTTONUP:{
    printf ("handle events: joybuttonup move=%i\n",move);
    //	printf ("handle events: joybuttonup\n");
    	switch( event.jbutton.button ){
      case GP2X_BUTTON_CLICK:
      	break;
      case GP2X_BUTTON_START:
    	
      	break;
      case GP2X_BUTTON_SELECT:
    	
      	break;
      case GP2X_BUTTON_VOLUP:
    	
      	break;
      case GP2X_BUTTON_VOLDOWN:
    	
      	break;
      case GP2X_BUTTON_LEFT :
      	move=0;    	
      	break;
      case GP2X_BUTTON_RIGHT :
      	move=0;
      	break;
      case GP2X_BUTTON_UP :
      	move=0;
      	break;
      case GP2X_BUTTON_DOWN :
      	move=0;
      	break;
      case GP2X_BUTTON_UPLEFT :
      	move=0;    	
      	break;
      case GP2X_BUTTON_DOWNRIGHT :
      	move=0;
      	break;
      case GP2X_BUTTON_UPRIGHT :
      	move=0;
      	break;
      case GP2X_BUTTON_DOWNLEFT :
      	move=0;
      	break;
      case GP2X_BUTTON_Y:
    	
      	break;
      case GP2X_BUTTON_B:
      {
      	ADBMouseUp(0);
      	break;
      }
      case GP2X_BUTTON_X :
    	
      	break;
      case GP2X_BUTTON_A :
    	
      	break;
      case GP2X_BUTTON_L :
    	
      	break;
      case GP2X_BUTTON_R :
    	
      	break;
      default:
      	break;
      }	
    	}
  	
	}
//	printf("move = %i\n",move);
	if (move==1) {
	switch (dirn){
	case GP2X_BUTTON_LEFT :
  joyx--;
  if (joyx<0) joyx=0;
  drv->mouse_moved(joyx, joyy);
  break;
	case GP2X_BUTTON_RIGHT :
  joyx++;
  if (joyx>widthx) joyx=widthx;
  drv->mouse_moved(joyx, joyy);
  break;
	case GP2X_BUTTON_UP :
  joyy--;
  if (joyy<0) joyy=0;
  drv->mouse_moved(joyx, joyy);
  break;
	case GP2X_BUTTON_DOWN :
  joyy++;
  if (joyy>widthy) joyy=widthy;
  drv->mouse_moved(joyx, joyy);
  break;
	case GP2X_BUTTON_UPLEFT :
  joyx--;
  joyy--;
  if (joyx<0) joyx=0;
  if (joyy<0) joyy=0;
  drv->mouse_moved(joyx, joyy);
  break;
	case GP2X_BUTTON_DOWNRIGHT :
  joyx++;
  joyy++;
  if (joyy>widthy) joyy=widthy;
  if (joyx>widthx) joyx=widthx;
  drv->mouse_moved(joyx, joyy);
  break;
	case GP2X_BUTTON_UPRIGHT :
  joyy--;
  joyx++;
  if (joyx>widthx) joyx=widthx;
  if (joyy<0) joyy=0;
  drv->mouse_moved(joyx, joyy);
  break;
	case GP2X_BUTTON_DOWNLEFT :
  joyy++;
  joyx--;
  if (joyx<0) joyx=0;
  if (joyy>widthy) joyy=widthy;
  drv->mouse_moved(joyx, joyy);
  break;
  }
	}
}
 
Thanks lutejin, while rewriting the code according to your suggestions, I noticed I left out a break statement in the old code. So mouse is fixed now.
Any suggestions where I can get some virtual keyboard code from?
sterm?
Bochs?
 
Hi I get this when I compile BasiliskII. Does this mean that ethernet wont work? Can anyone with a network enebled kernel check if you can get network on BasiliskII?
Ay suggestions?
Code:
gp2x-g++ -o BasiliskII -static          obj/main.o obj/main_unix.o obj/prefs.o obj/prefs_items.o obj/prefs_unix.o obj/sys_unix.o obj/rom_patches.o obj/slot_rom.o obj/rsrc_patches.o obj/emul_op.o obj/macos_util.o obj/xpram.o obj/xpram_unix.o obj/timer.o obj/timer_unix.o obj/adb.o obj/serial.o obj/ether.o obj/sony.o obj/disk.o obj/cdrom.o obj/scsi.o obj/video.o obj/video_blit.o obj/vm_alloc.o obj/sigsegv.o obj/audio.o obj/extfs.o obj/user_strings.o obj/user_strings_unix.o obj/sshpty.o obj/strlcpy.o obj/video_sdl.o obj/extfs_unix.o obj/serial_unix.o obj/ether_unix.o obj/scsi_linux.o obj/audio_sdl.o obj/prefs_editor_dummy.o obj/clip_dummy.o obj/basilisk_glue.o obj/memory.o obj/newcpu.o obj/readcpu.o obj/fpu_ieee.o obj/cpustbl.o obj/cpudefs.o obj/cpuemu1.o obj/cpuemu2.o obj/cpuemu3.o obj/cpuemu4.o obj/cpuemu5.o obj/cpuemu6.o obj/cpuemu7.o obj/cpuemu8.o obj/bootp.o obj/ip_output.o obj/tcp_input.o obj/cksum.o obj/mbuf.o obj/tcp_output.o obj/debug.o obj/misc.o obj/tcp_subr.o obj/if.o obj/sbuf.o obj/tcp_timer.o obj/ip_icmp.o obj/slirp.o obj/tftp.o obj/ip_input.o obj/socket.o obj/udp.o -lpthread -lm -lrt -lrt  -L/usr/local/gp2xdev/lib -Wl,-rpath,/usr/local/gp2xdev/lib -lSDL -lpthread
obj/ether.o: In function `EtherInit()':
ether.cpp:(.text+0x1bc): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking
 
ether.cpp:(.text+0x1bc): warning: Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking

you'll most probably not have these libs available at runtime, so any calls to gethostbyname will probably cause trouble. you could just rip out that part and do the name resolving (if needed at all) by hand.

I wouldn't worry too much about it for now.

P.
 
Couldn't get network to work. Give up for the time being.
What is the best resolution to use for tvout?
on PAL setting
720x480 rubbish on lower end of screen
720x505 rubbish on lower end of screen
640x480 not clear
768x576 not clear
720x576 clear, but lower end of screen off screen, right side of screen off scale
on NTSC setting
720x480 clear, but lower end of screen off screen, right side of screen off scale
720x576 clear, but lower end of screen off screen, right side of screen off scale(worse)
 
Back
Top