public static void shogwarr_mcu_run()
	{
		int mcu_command;
	
		if ( shogwarr_mcu_status != (1|2|4|8) )	return;
	
		mcu_command = mcu_ram.READ_WORD(shogwarr_mcu_command_offset);
	
		if (mcu_command==0) return;
	
		if (errorlog!=null) fprintf(errorlog,
		 "CPU #0 PC %06X : MCU executed command at %04X: %04X\n",
		 	cpu_get_pc(),shogwarr_mcu_command_offset,mcu_command);
	
		switch (mcu_command)
		{
	
			case 0x00ff:
			{
				int param1 = mcu_ram.READ_WORD(shogwarr_mcu_command_offset + 0x0002);
				int param2 = mcu_ram.READ_WORD(shogwarr_mcu_command_offset + 0x0004);
				int param3 = mcu_ram.READ_WORD(shogwarr_mcu_command_offset + 0x0006);
	//			int param4 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x0008]);
				int param5 = mcu_ram.READ_WORD(shogwarr_mcu_command_offset + 0x000a);
	//			int param6 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x000c]);
	//			int param7 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x000e]);
	
				// clear old command (handshake to main cpu)
				mcu_ram.WRITE_WORD(shogwarr_mcu_command_offset, 0x0000);
	
				// execute the command:
	
				COMBINE_WORD_MEM(mcu_ram,param1 & (~1),
					(param1 & 1)!=0 ?
						(0xff000000 | (~readinputport(4)<<0) ) :
						(0x00ff0000 | (~readinputport(4)<<8) ) );	// DSW
	
				COMBINE_WORD_MEM(mcu_ram,param2 & (~1),
					(param2 & 1)!=0 ?
						(0xff000000 | (0xff<<0) ) :
						(0x00ff0000 | (0xff<<8) ) );	// ? -1 / anything else
	
				shogwarr_mcu_command_offset = param3;	// where next command will be written?
				// param 4?
				mcu_ram.WRITE_WORD(param5, 0x8ee4);	// MCU Rom Checksum
				// param 6&7 = address.l
			}
			break;
	
	
			case 0x0001:
			{
	//			int param1 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x0002]);
				int param2 = mcu_ram.READ_WORD(shogwarr_mcu_command_offset + 0x0004);
	
				// clear old command (handshake to main cpu)
				mcu_ram.WRITE_WORD(shogwarr_mcu_command_offset, 0x0000);
	
				// execute the command:
	
				// param1 ?
				mcu_ram.WRITE_WORD(param2+0x0000, 0x0000 );	// ?
				mcu_ram.WRITE_WORD(param2+0x0002, 0x0000 );	// ?
				mcu_ram.WRITE_WORD(param2+0x0004, 0x0000 );	// ?
	
				mcu_ram.WRITE_WORD(param2+0x0006, 0x0000 );	// ? addr.l
				mcu_ram.WRITE_WORD(param2+0x0008, 0x00e0 );	// 0000e0: 4e73 rte
	
			}
			break;
	
	
			case 0x0002:
			{
	//			int param1 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x0002]);
	//			int param2 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x0004]);
	//			int param3 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x0006]);
	//			int param4 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x0008]);
	//			int param5 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x000a]);
	//			int param6 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x000c]);
	//			int param7 = READ_WORD(&mcu_ram[shogwarr_mcu_command_offset + 0x000e]);
	
				// clear old command (handshake to main cpu)
				mcu_ram.WRITE_WORD(shogwarr_mcu_command_offset, 0x0000);
	
				// execute the command:
	
			}
			break;
	
		}
	
	}