Beispiel #1
0
void Psx::Execute() {
	if (!conf->bBiosLoaded) {
		MessageBox(mMainWnd->GetHwnd(), "BIOS not loaded", "Error", MB_ICONERROR);
		return;
	}
	StartEmulation();
}
Beispiel #2
0
bool TNekoDriver::RunDemoBin( const QString& filename )
{
    if (filename.isEmpty()) {
        //LoadDemoNor(QApplication::applicationDirPath() + "/mario.bin");
        LoadBROM(QApplication::applicationDirPath() + "/obj.bin");
        LoadFullNorFlash(QApplication::applicationDirPath() + "/cc800.fls");
        //fixedram0000[io00_bank_switch] = 2;
        //SwitchNorBank(2);
        //*(unsigned short*)&(pmemmap[mapE000][0x1FFC]) = 0x4018; // mario.bin
    } else {
        LoadDemoNor(filename);
        fixedram0000[io00_bank_switch] = 1;
        SwitchNorBank(1);
        *(unsigned short*)&(pmemmap[mapE000][0x1FFC]) = 0x4018; // mario.bin
    }
    //fEmulatorThread->start(QThread::InheritPriority);
    StopEmulation();
    StartEmulation();
    return true;
}
Beispiel #3
0
void Psx::StartSaveStateEmulation(const char *filename) {
	if (!RestoreSaveStateFile(filename)) {
		return;
	}
	StartEmulation();
}
Beispiel #4
0
BOOL CALLBACK PluginSelectProc (HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) {
	char Plugin[300];
	HMODULE hLib;
	DWORD count, index;

	switch (uMsg) {
	case WM_INITDIALOG:
		SetupPluginScreen(hDlg);
		break;
	case WM_COMMAND:
		switch (LOWORD(wParam)) {		
#ifndef EXTERNAL_RELEASE
		case RSP_LIST:
			if (HIWORD(wParam) == CBN_SELCHANGE) {				
				index = SendMessage(GetDlgItem(hDlg,RSP_LIST),CB_GETCURSEL,0,0);				
				if (index == CB_ERR) { break; } // *** Add in Build 53
				index = SendMessage(GetDlgItem(hDlg,RSP_LIST),CB_GETITEMDATA,(WPARAM)index,0);

				GetPluginDir(Plugin);
				strcat(Plugin,PluginNames[index]);
				hLib = LoadLibrary(Plugin);		
				if (hLib == NULL) { DisplayError("%s %s",GS(MSG_FAIL_LOAD_PLUGIN),Plugin); }
				RSPDllAbout = (void (__cdecl *)(HWND))GetProcAddress( hLib, "DllAbout" );
				EnableWindow(GetDlgItem(hDlg,RSP_ABOUT),RSPDllAbout != NULL ? TRUE:FALSE);
			}
			break;
#endif
		case GFX_LIST:
			if (HIWORD(wParam) == CBN_SELCHANGE) {
				index = SendMessage(GetDlgItem(hDlg,GFX_LIST),CB_GETCURSEL,0,0);
				if (index == CB_ERR) { break; } // *** Add in Build 53
				index = SendMessage(GetDlgItem(hDlg,GFX_LIST),CB_GETITEMDATA,(WPARAM)index,0);

				GetPluginDir(Plugin);
				strcat(Plugin,PluginNames[index]);
				hLib = LoadLibrary(Plugin);		
				if (hLib == NULL) { DisplayError("%s %s",GS(MSG_FAIL_LOAD_PLUGIN),Plugin); }
				_GFXDllAbout = (void (__cdecl *)(HWND))GetProcAddress( (HMODULE)hLib, "DllAbout" );
				EnableWindow(GetDlgItem(hDlg,GFX_ABOUT), _GFXDllAbout != NULL ? TRUE:FALSE);
			}
			break;
		case AUDIO_LIST:
			if (HIWORD(wParam) == CBN_SELCHANGE) {
				index = SendMessage(GetDlgItem(hDlg,AUDIO_LIST),CB_GETCURSEL,0,0);
				if (index == CB_ERR) { break; } // *** Add in Build 53
				index = SendMessage(GetDlgItem(hDlg,AUDIO_LIST),CB_GETITEMDATA,(WPARAM)index,0);

				GetPluginDir(Plugin);
				strcat(Plugin,PluginNames[index]);
				hLib = LoadLibrary(Plugin);		
				if (hLib == NULL) { DisplayError("%s %s",GS(MSG_FAIL_LOAD_PLUGIN),Plugin); }
				_AiDllAbout = (void (__cdecl *)(HWND))GetProcAddress( (HMODULE)hLib, "DllAbout" );
				EnableWindow(GetDlgItem(hDlg,GFX_ABOUT), _AiDllAbout != NULL ? TRUE:FALSE);
			}
			break;
		case CONT_LIST:
			if (HIWORD(wParam) == CBN_SELCHANGE) {
				index = SendMessage(GetDlgItem(hDlg,CONT_LIST),CB_GETCURSEL,0,0);
				if (index == CB_ERR) { break; } // *** Add in Build 53
				index = SendMessage(GetDlgItem(hDlg,CONT_LIST),CB_GETITEMDATA,(WPARAM)index,0);

				GetPluginDir(Plugin);
				strcat(Plugin,PluginNames[index]);
				hLib = LoadLibrary(Plugin);		
				if (hLib == NULL) { DisplayError("%s %s",GS(MSG_FAIL_LOAD_PLUGIN),Plugin); }
				_ContDllAbout = (void (__cdecl *)(HWND))GetProcAddress( (HMODULE)hLib, "DllAbout" );
				EnableWindow(GetDlgItem(hDlg,CONT_ABOUT), _ContDllAbout != NULL  ? TRUE:FALSE);
			}
			break;
#ifndef EXTERNAL_RELEASE
		case RSP_ABOUT: RSPDllAbout(hDlg); break;
#endif
		case GFX_ABOUT: GFXDllAbout(hDlg); break;
		case CONT_ABOUT: ContDllAbout(hDlg); break;
		case AUDIO_ABOUT: AiDllAbout(hDlg); break;
		}
		break;
	case WM_NOTIFY:
		if (((NMHDR FAR *) lParam)->code == PSN_APPLY) { 
			long lResult;
			HKEY hKeyResults = 0;
			DWORD Disposition = 0;
			char String[200];

			if (PluginsChanged(hDlg) == FALSE) { break; }

			if (CPURunning) { 
				int Response;

				ShowWindow(hDlg,SW_HIDE);
				Response = MessageBox(hMainWindow,GS(MSG_PLUGIN_CHANGE),GS(MSG_PLUGIN_CHANGE_TITLE),MB_YESNO|MB_ICONQUESTION);
				if (Response != IDYES) { break; }
			}

			sprintf(String,"Software\\N64 Emulation\\%s\\Dll",AppName);
			lResult = RegCreateKeyEx( HKEY_CURRENT_USER, String,0,"", REG_OPTION_NON_VOLATILE,
				KEY_ALL_ACCESS,NULL, &hKeyResults,&Disposition);
			if (lResult == ERROR_SUCCESS) {
				DWORD index;

#ifndef EXTERNAL_RELEASE
				index = SendMessage(GetDlgItem(hDlg,RSP_LIST),CB_GETCURSEL,0,0);
				index = SendMessage(GetDlgItem(hDlg,RSP_LIST),CB_GETITEMDATA,(WPARAM)index,0);
				sprintf(String,"%s",PluginNames[index]);
				RegSetValueEx(hKeyResults,"RSP Dll",0,REG_SZ,(CONST BYTE *)String,
					strlen(String));
#endif
				index = SendMessage(GetDlgItem(hDlg,GFX_LIST),CB_GETCURSEL,0,0);
				index = SendMessage(GetDlgItem(hDlg,GFX_LIST),CB_GETITEMDATA,(WPARAM)index,0);
				sprintf(String,"%s",PluginNames[index]);
				RegSetValueEx(hKeyResults,"Graphics Dll",0,REG_SZ,(CONST BYTE *)String,
					strlen(String));
				index = SendMessage(GetDlgItem(hDlg,AUDIO_LIST),CB_GETCURSEL,0,0);
				index = SendMessage(GetDlgItem(hDlg,AUDIO_LIST),CB_GETITEMDATA,(WPARAM)index,0);
				sprintf(String,"%s",PluginNames[index]);
				RegSetValueEx(hKeyResults,"Audio Dll",0,REG_SZ,(CONST BYTE *)String,
					strlen(String));
				index = SendMessage(GetDlgItem(hDlg,CONT_LIST),CB_GETCURSEL,0,0);
				index = SendMessage(GetDlgItem(hDlg,CONT_LIST),CB_GETITEMDATA,(WPARAM)index,0);
				sprintf(String,"%s",PluginNames[index]);
				RegSetValueEx(hKeyResults,"Controller Dll",0,REG_SZ,(CONST BYTE *)String,
					strlen(String));
			}
			RegCloseKey(hKeyResults);
			if (CPURunning) { 
				CloseCpu();
				SetupPlugins(hMainWindow);				
				StartEmulation();
			} else {
				if (!RomBrowser) { SetupPlugins(hMainWindow); }
				if (RomBrowser) { SetupPlugins(hHiddenWin); }
			}
		}
		if (((NMHDR FAR *) lParam)->code == PSN_RESET) { 
			for (count = 0; count <	PluginCount; count ++ ) { free(PluginNames[count]); }
		}
		break;
	default:
		return FALSE;
	}
	return TRUE;
}