怎么把MAME32模拟器里的游戏移到别的模拟器

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了怎么把MAME32模拟器里的游戏移到别的模拟器相关的知识,希望对你有一定的参考价值。

我想把MAME32里面的游戏移到WinKawaks模拟器里 可是我不会
求教

你好。
mame模拟器支持cps1、cps2、neogeo、mame、PGM、3D等各种基板的游戏,最新版的mame模拟器支持数千个游戏。
而kawaks模拟器目前只支持cps1、cps2、neogeo这3个基板的游戏。

如果你想把mame模拟器里所有游戏都移到kawaks模拟器里的话,目前kawaks模拟器的还不能实现。最多也只能把mame模拟器里cps1、cps2、neogeo基板的游戏移到kawaks模拟器里而已。

如果你想用kawaks模拟器玩mame模拟器里的cps1、cps2、neogeo游戏的话,只要打开kawaks模拟器,点击模拟器菜单第一项,里面有一个路径设置,把里面的一个路径设置到mame模拟器的roms文件夹里就行了。
因为mame模拟器的roms文件夹就是存放游戏包的地方,这样设置路径的话,就相当于mame模拟器和kawaks模拟器共用通一个游戏包存放文件夹。

试一下吧,祝你玩的开心。
参考技术A 打开MAME32的目录找到roms这个文件夹,然后复制到winkawaks模拟器目录中 (roms文件夹中的压缩文件就是街机游戏,因此你以后只要将下载的街机游戏压缩文件放到roms中就可以进行游戏。)

mame模拟器添加按键实现

osdinput.c文件里面,主要是这样子设置的:

	input_device_item_add(devinfo, "Bt_B", &joy_buttons[i][0], ITEM_ID_BUTTON1, my_get_state);
		input_device_item_add(devinfo, "Bt_X", &joy_buttons[i][1], ITEM_ID_BUTTON2, my_get_state);
		input_device_item_add(devinfo, "Bt_A", &joy_buttons[i][2], ITEM_ID_BUTTON3, my_get_state);
		input_device_item_add(devinfo, "Bt_Y", &joy_buttons[i][3], ITEM_ID_BUTTON4, my_get_state);
		input_device_item_add(devinfo, "Bt_L", &joy_buttons[i][4], ITEM_ID_BUTTON5, my_get_state);
		input_device_item_add(devinfo, "Bt_R", &joy_buttons[i][5], ITEM_ID_BUTTON6, my_get_state);

		input_device_item_add(devinfo, "Coin", &joy_buttons[i][6], ITEM_ID_BUTTON7, my_get_state);
		input_device_item_add(devinfo, "Start", &joy_buttons[i][7], ITEM_ID_BUTTON8, my_get_state);

		input_device_item_add(devinfo, "X Axis", &joy_axis[i][0], ITEM_ID_XAXIS, my_axis_get_state);
		input_device_item_add(devinfo, "Y Axis", &joy_axis[i][1], ITEM_ID_YAXIS, my_axis_get_state);

		input_device_item_add(devinfo, "D-Pad Up", &joy_hats[i][0],(input_item_id)( ITEM_ID_HAT1UP+i*4), my_get_state);
		input_device_item_add(devinfo, "D-Pad Down", &joy_hats[i][1],(input_item_id)( ITEM_ID_HAT1DOWN+i*4), my_get_state);
		input_device_item_add(devinfo, "D-Pad Left", &joy_hats[i][2], (input_item_id)(ITEM_ID_HAT1LEFT+i*4), my_get_state);
		input_device_item_add(devinfo, "D-Pad Right", &joy_hats[i][3], (input_item_id)(ITEM_ID_HAT1RIGHT+i*4), my_get_state);

这里注册设备,然后对应的名字,以及这个对应的从哪个数组里面拿数值。

static INT32 my_get_state(void *device_internal, void *item_internal)

	UINT8 *keystate = (UINT8 *)item_internal;
	return *keystate;

这个方法,是模拟器内部调用,我们只需要改动前面的值就可以了。、
我们使用的地方:
droid_ios_poll_input
这里面,是上层的按钮按下,弹起,会将这里面的一些数组改,主要是按下:0x80,弹起0x0
通过这两个值,模拟器会得到一次按下,然后驱动模拟器内部运行。

void droid_ios_poll_input(running_machine *machine)
    
    my_poll_ports(machine);
    
    long _pad_status = joystick_read(0);
    
    netplay_t *handle = netplay_get_handle();
    int netplay = handle->has_connection && handle->has_begun_game;
    
	if(mystate == STATE_NORMAL)
	

		keyboard_state[KEY_1] = 0;
		keyboard_state[KEY_2] = 0;

		if(myosd_exitGame || handle->state.ext & NP_EXIT || handle->peer_state.ext & NP_EXIT)
		
            if(netplay)
            
                if(myosd_in_menu)
                
                    if(handle->state.ext & NP_EXIT || handle->peer_state.ext & NP_EXIT)
                    
                        keyboard_state[KEY_ESCAPE] = 0x80;
                        myosd_ext_status &= ~ NP_EXIT;
                    
                    else
                    
                        myosd_ext_status |= NP_EXIT;
                    
                
                else
                
                    handle->has_connection = 0;
                    handle->has_begun_game = 0;
                    keyboard_state[KEY_ESCAPE] = 0x80;
                
            
            else
            
                handle->has_begun_game = 0;//ensure for auto disconnect 
                keyboard_state[KEY_ESCAPE] = 0x80;
			
            
            myosd_exitGame = 0;
            handle->state.ext &= ~ NP_EXIT;
            handle->peer_state.ext &= ~ NP_EXIT;
		
	    else
	    
			keyboard_state[KEY_ESCAPE] = 0;
            
            if(myosd_reset_filter==1)
                myosd_exitGame= 1;
            
        
        
		if(myosd_service && !myosd_in_menu && !netplay)
		
			keyboard_state[KEY_SERVICE] = 0x80;
			myosd_service = 0;
		
	    else
	    
			keyboard_state[KEY_SERVICE] = 0;
        

		keyboard_state[KEY_LOAD] =  0;
		keyboard_state[KEY_SAVE] =  0;

		if(myosd_savestate || handle->state.ext & NP_SAVE || handle->peer_state.ext & NP_SAVE)
		
            if(netplay)
            
                if(handle->state.ext & NP_SAVE || handle->peer_state.ext & NP_SAVE)
                
                    keyboard_state[KEY_SAVE] =  0x80;
                    mystate = STATE_LOADSAVE;
                    myosd_ext_status &= ~ NP_SAVE;
                
                else
                
                    myosd_ext_status |= NP_SAVE;
                
            
            else
            
                keyboard_state[KEY_SAVE] =  0x80;
                mystate = STATE_LOADSAVE;
            

            handle->state.ext &= ~ NP_SAVE;
            handle->peer_state.ext &= ~ NP_SAVE;
            myosd_savestate = 0;
            myosd_fs_counter = 60 * 5;
            return;
		

		if(myosd_loadstate || handle->state.ext & NP_LOAD || handle->peer_state.ext & NP_LOAD)
		
            if(netplay)
            
                if(handle->state.ext & NP_LOAD || handle->peer_state.ext & NP_LOAD)
                
                    keyboard_state[KEY_LOAD] =  0x80;
                    mystate = STATE_LOADSAVE;
                    myosd_ext_status &= ~ NP_LOAD;
                
                else
                
                    myosd_ext_status |= NP_LOAD;
                
            
            else
            
               keyboard_state[KEY_LOAD] =  0x80;
			   mystate = STATE_LOADSAVE;
            
            
            handle->state.ext &= ~ NP_LOAD;
            handle->peer_state.ext &= ~ NP_LOAD;
            myosd_loadstate = 0;
            myosd_fs_counter = 60 * 5;
            return;
		

		for(int i=0; i<4; i++)
		
			if(i!=0  && myosd_in_menu==1 && myosd_num_of_joys <=1)//to avoid mapping issues when pxasp1 is active
				break;

			_pad_status = joystick_read(i);

			if(i==0)
			
				if(!myosd_inGame && !myosd_in_menu)
				
					keyboard_state[KEY_PGUP] = ((_pad_status & MYOSD_LEFT) != 0) ? 0x80 : 0;
					keyboard_state[KEY_PGDN] = ((_pad_status & MYOSD_RIGHT) != 0) ? 0x80 : 0;
				
				else
				
					keyboard_state[KEY_PGUP] = 0;
					keyboard_state[KEY_PGDN] = 0;
				
                
                if((_pad_status & MYOSD_START /*& MYOSD_SELECT*/)  &&  (_pad_status /*& MYOSD_A*/ & MYOSD_L1) && myosd_saveload_combo)
                
                    myosd_savestate = 1;
                    break;
                
                if((_pad_status /*& MYOSD_SELECT*/ & MYOSD_START)  &&  (_pad_status /*& MYOSD_A*/ & MYOSD_R1) && myosd_saveload_combo)
                
                    myosd_loadstate = 1;
                    break;
                
			

            // lo cambio de 0 a i...
			if(joystick_read_analog(i, 'x') == 0 && joystick_read_analog(i, 'y')==0)
			
			   joy_hats[i][0] = ((_pad_status & MYOSD_UP) != 0) ? 0x80 : 0;
			   joy_hats[i][1] = ((_pad_status & MYOSD_DOWN) != 0) ? 0x80 : 0;
			   joy_hats[i][2] = ((_pad_status & MYOSD_LEFT) != 0) ? 0x80 : 0;
			   joy_hats[i][3] = ((_pad_status & MYOSD_RIGHT) != 0) ? 0x80 : 0;
			   joy_axis[i][0] = 0;
			   joy_axis[i][1] = 0;
   
                           lightgun_axis[i][0] = (int)(lightgun_x[myosd_pxasp1 ? 0 : i] *  32767 *  2 );
  			   lightgun_axis[i][1] = (int)(lightgun_y[myosd_pxasp1 ? 0 : i] *  32767 * -2 );
                           
			
			else
			
			   
                           joy_axis[i][0] = (int)(joystick_read_analog(i, 'x') *  32767 *  2 );
			   joy_axis[i][1] = (int)(joystick_read_analog(i, 'y') *  32767 * -2 );
			   joy_hats[i][0] = 0;
			   joy_hats[i][1] = 0;
			   joy_hats[i][2] = 0;
			   joy_hats[i][3] = 0;

                           lightgun_x[i] = 0;                              
                           lightgun_y[i] = 0;                              
                           lightgun_axis[i][0] = 0;
                           lightgun_axis[i][1] = 0;

			
            
            if(myosd_inGame && !myosd_in_menu && myosd_autofire && !netplay)
            
                old_B_pressed[i] = B_pressed[i];
                B_pressed[i] = _pad_status & MYOSD_B;
                
                if(!old_B_pressed[i] && B_pressed[i])
                
                   enabled_autofire[i] = !enabled_autofire[i];
                
            
            else
                enabled_autofire[i] = false;

			if(enabled_autofire[i])//AUTOFIRE
            
                int value  = 0;
                switch (myosd_autofire) 
                    case 1: value = 1;break;
                    case 2: value = 2;break;
                    case 3: value = 4; break;
                    case 4: value = 6; break;
                    case 5: value = 8; break;
                    case 6: value = 10; break;
                    case 7: value = 13; break;
                    case 8: value = 16; break;
                    case 9: value = 20; break;
                    default:
                        value = 6; break;
                        break;
                
                                
                joy_buttons[i][0] = fire[i]++ >=value ? 0x80 : 0;
                if(fire[ i] >= value*2)
                    fire[ i] = 0;
                
            
            else
               joy_buttons[i][0]  = ((_pad_status & MYOSD_B) != 0) ? 0x80 : 0;
            
			joy_buttons[i][1]  = ((_pad_status & MYOSD_X) != 0) ? 0x80 : 0;
			joy_buttons[i][2]  = ((_pad_status & MYOSD_A) != 0) ? 0x80 : 0;
			joy_buttons[i][3]  = ((_pad_status & MYOSD_Y) != 0) ? 0x80 : 0;
			joy_buttons[i][4]  = ((_pad_status & MYOSD_L1) != 0) ? 0x80 : 0;
			joy_buttons[i][5]  = ((_pad_status & MYOSD_R1) != 0) ? 0x80 : 0;

			if(i!=0  && (myosd_num_of_joys==1 || myosd_num_of_joys==0) && !netplay)
				continue;

			joy_buttons[i][6]  = ((_pad_status & MYOSD_SELECT ) != 0) ? 0x80 : 0;
			joy_buttons[i][7]  = ((_pad_status & MYOSD_START  ) != 0) ? 0x80 : 0;
		
	
	else if(mystate == STATE_LOADSAVE)
	
		
        keyboard_state[KEY_ESCAPE] = 0;
		keyboard_state[KEY_1] = 0;
		keyboard_state[KEY_2] = 0;

		if(myosd_exitGame || handle->state.ext & NP_EXIT || handle->peer_state.ext & NP_EXIT)
		
            if(netplay)
            
                if(handle->state.ext & NP_EXIT || handle->peer_state.ext & NP_EXIT)
                
                    keyboard_state[KEY_ESCAPE] = 0x80;
                    mystate = STATE_NORMAL;
                    myosd_ext_status &= ~ NP_EXIT;
                
                else
                
                    myosd_ext_status |= NP_EXIT;
                
            
            else
            
                keyboard_state[KEY_ESCAPE] = 0x80;
                mystate = STATE_NORMAL;
			
			
            myosd_exitGame = 0;
            handle->state.ext &= ~ NP_EXIT;
            handle->peer_state.ext &= ~ NP_EXIT;
		

		if ((_pad_status & MYOSD_B) != 0)
		
			keyboard_state[KEY_1] = 0x80;以上是关于怎么把MAME32模拟器里的游戏移到别的模拟器的主要内容,如果未能解决你的问题,请参考以下文章

我想玩街机游戏!下载了MAME模拟器,但不知道怎么用

徕卡TS60模拟器怎么改成中文?

MAME 0.201 发布,重温童年的街机模拟器

MAME街机模拟器如何设置操作

以下哪种配置玩FM之类的大型2D游戏比较流畅,注意是2D游戏!

nebula2.25模拟器宏设置